I'm trying to create a multidimensional array to keep strings in it, with a length of 5. However it seems to be problem when i try to print out a sinle element from the arrays.
In my printf("%s", a[0][0][5]) it should print out "hej0" in a char array last [5]stand for the amout of characters of the current element + '\o' And first and second [] stand for row and which element to target?
When i try to compile this code it will just crash.
int main() {
char a[3][4][5] = {
{"hej0", "hej1", "hej2", "hej3"} ,
{"hej4", "hej5", "hej6", "hej7"} ,
{"hej8", "hej9", "hej10", "hej11"}
};
printf("%s", a[0][0][5]);
return 0;
}
char a[3][4][6]since you have some 5 character strings which need 6 bytes including terminator.