I want to use an array of pointers in a function and then visualize his values on the main function. I thought to use the array of pointer as a global variable but on the main function it doesn't show the same values of the void function. This is my first time asking a quest on stackoverflow so consider me as a beginner.
int *temp[65];
static void save_value(int t){
int vet[64];
int sum;
int i;
for(i=0;i<64;i++){
vet[i]=0;
temp[i]=0;
}
for(i=0; i<64; i++){
sum = t ++;
vet[i]=sum;
temp[i]=&vet[i];
printf("Temp for = %d\n", *temp[i]);
}
printf("\n");
}
int main(int argc, char** argv) {
int i;
int value;
value=1;
save_value(value);
for(i=0; i<64; i++){
printf("Temp = %d\n", *temp[i]);
}
return 0;
}