Here is some sample jave code. Is this possible in C++ too?
public class Example {
public static void main(String args[]){
int[][] a = new int[3][];
a[0] = new int[]{1};
a[1] = new int[]{1,2};
a[2] = new int[]{1,2,3};
display(a);
}
}
You should use a pointer to pointers, alike argv that you receive from main(char **argv, … argc)
a string is a array of chars, and argv is an pointer for that scructure.
You should use int **a, then create line by line in memory,
a should point:
like when you do
when whe use char strings there’s an ‘\0’ char at the end, so it’s possible to know when it finishes, in that case must have some king of control, unlike Java in C you can overflow.