I'm trying to find the memory locations of the elements of an array. The function is basically this (in C):
int function(struct MyStruct *s)
{
char myArray[16];
printf("\n");
printf("\n");
gets(myArray);
return strcasecmp(s->a,guess);
}
According to GDB guides online I should be able to do "x myArray" or "x myArray[0]" or "p myArray" or "p myArray[0]" to see the elements or memory locations. I set up breakpoints at function and gets (and continued until the gets breakpoint), but when I tried the GDB commands, I got "no such file." I also tried "b 15" to set a breakpoint at the array and "b 16." but I still got the same error. Why is this happening and how can I fix it?