I know that strings in C are basically an array of characters.
I was trying have an array of pointers, pointers which link to the strings
I basically wanted to print this out, without depending on '\n' to sort it
12345
abcde
67890
fghij
This is my code - >
char *array1 = "12345";
char *array2 = "abcde";
char *array3 = "67890";
char *array4 = "fghij";
char *array_2d[3];
array_2d[0] = &array1;
array_2d[1] = &array2;
array_2d[2] = &array3;
array_2d[3] = &array4;
int i,j;
for(i = 0; i<3 ; i++ ) {
for(j = 0; j<3 ; j++) {
printf("%c", array_2d[i][j]);
}
}
i might be making mistakes, so any clues would be appreciated