Use his address:
char a[100][100]; char *p; for(int i=0;i<4;i++) for(int j=0;j<4;j++) if(a[i][j] == 'T') p = &a[i][j];
a[i][j] is of type char and p is of type char * , which contains the address. To get the address of a variable, add it with & .
The * operator on the pointer works the other way around. If you want to bring 'T' back, you should use:
char theT = *p;
Bart friederichs
source share