0
pls explain how this assignment operator works...is it a 2d array or 1d array?
char a[]={"0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "!@#$%^&*?_:"};
6 Réponses
+ 4
You are declaring a 1d array and assigning a 2d array to it (strings are arrays of chars). It works because there isn't any difference in the implementation of multidimensional arrays, the data is still put contiguously. In the end, it's a 1d array.
Actually, the second array may not even be a 2d array in the first place, since there are no commas.
+ 4
If you write string literals next to each other they will just be concatenated by the compiler. So it's just a single big string.
+ 2
No, you will get the character '1' instead (I've tested).
+ 2
0
Zen what if i write a[1] wil it access ABCDEF.....?