Are the sizes and statements for the entire array stated in the comments in the code below correct?
//gArray uses sizeof(char)*100 = 1*100 = 100 bytes.
char gArray[100];
//gArray uses sizeof(char)*100*50 = 1*100*50 = 5000 bytes.
char gArray[100][50];
//gArray is a 2D array, each element is a pointer to a char (although
//char data type is irrelevant).
//gArray uses sizeof(void*)*100*50 = (4 or 8) * 100 * 50 = 20000 or 40000 bytes.
char* gArray[100][50];
Thanks.
You just print out the values:
I get: