I need an array which I can access from different methods, I have to allocate this array in main() and then let other functions like foo() get access to this array.
This question helped me with allocating the array: defining a 2D array with malloc and modifying it
I'm defining the array like this:
char(*array)[100] = malloc((sizeof *array) * 25200);
And I'm doing this in main()
I can store 25200 strings in this array an access them by array[1]
Is it now possible to access this array from different methods, how can I do that?
With this declaration:
You can have a function
foo
:and you can call
foo
this way: