What if we don't know exactly the size of array we gonna pass to func()?
How can we create a func() which can accept any size of array?
Type: Posts; User: gnncj
What if we don't know exactly the size of array we gonna pass to func()?
How can we create a func() which can accept any size of array?
For 2D array, we can pass the array to other function like:
int array[5][10];
...
func((int *)array, 5, 10);
...
...
int func(int *array, int x, int y) {
*(array + y * 0 + 8) = 1000; ...
Should be for( x = 0; argv[ x ]; x++ ) , not for( x = 0; *argv[ x ]; x++ ) . otherwise it will cause a segmentation fault.