Lets say we have 3 variables:
char a[4][4];
char *b[4];
char **c;
Lets say all of the above variables have correctly assigned values. There is no code errors.
All of these variables can print their values using [] operator like below:
for( i=0; i<4; i++){
printf( "%s\n", a[i] );
}
for( i=0; i<4; i++){
printf( "%s\n", b[i] );
}
for( i=0; i<4; i++){
printf( "%s\n", c[i] );
Just looking at these print statements there is no way to identify its true datatypes. How to identify its variable datatypes?
One idea I had was to print out the memory addresses of each index. With 2-D array, the memory address should be separated with equal distance from each other. But with pointer of array, I expected the memory addresses to be not uniformly spatially distant from each other. Is there a better way to find out datatypes of these variables?