I have this basic program:
int initfunc(int *array, int len) {
int i;
for(i=1; i <= len; i++) {
array[i] = i;
}
return 0;
}
int main(int argc, char* argv[]){
int* myarray=0;
initfunc(myarray,10);
}
First i'm trying to figure out what the command in GDB to find what memory address main is stored in.
And also my error is at line 4 (array[i] = i), i'm trying to figure out what I need to do to get it to run. My professor wrote this program so I get that using these pointers probably isn't a good way to code this basic program. I just need some insight since i'm not too great with pointers.