I need to do a simple thing, which I used to do many times in Java, but I\'m stuck in C (pure C, not C++). The situation looks like this:
int *a; void initA
You need to adjust the *a pointer, this means you need to pass a pointer to the *a. You do that like this:
int *a; void initArray( int **arr ) { *arr = malloc( sizeof( int ) * SIZE ); } int main() { initArray( &a ); return 0; }