I found the following declaration in my c Book, can anyone explain it:
char *dic[][40]={
"atlas", "A volume of maps",
"car", "a vehicle",
"telephone", "a communication device",
"", ""
}
Here what does the 40 means i.e. which dimension this is?
dicis a two-dimensional array ofchar*; its dimensions are 1 x 40.The 40 is given in the declarator and the 1 is implied by the fact that there is only one array in the initializer. The full initializer would have another set of braces, e.g.,
With the extra braces, it is clearer that the implicit dimension is 1.
Each element in the two-dimensional array is a pointer of type
char*. The first eight pointers are initialized to point to the eight string literals given in the initializer.