Hello,
I've an external/global array that is used every where in my code.
// global.h file
short is_valid[10];
I initialize my array somewhere in the code and I want to check if everything works. When I try to print the values of the array, I get segmentation fault.
// .c file
short *pValid = is_valid;
memset(&pValid, 1, 10 * sizeof (short));
for (i = 0; i < 10; i++)
printf("%d ", *(&pValid[i])); // the seg fault is here
printf("\n");
What do you recommend?
Thank you!