I have the following code
#include <stdio.h>
#define T_INT 5
int main(int argc, char *argv[]) {
int v[T_INT],i;
int *p = &v;
/* Preenchendo o vetor*/
for (i=0;i<T_INT;i++){
v[i] = i;
}
/* Tentando ler com o ponteiro incrementando o endereço */
for (i=0;i<T_INT;i++){
printf("%d\n",(*p));
(*p++);
}
}
I know I could use [], but I'm opting to use it for academic reasons, how could I reset this pointer to home position?
Considering that I can not use the variable 'v' anymore because it can is out of scope