My first name has six letters and my second name has four.
The incorrect code will build and print:
char myName[4][6] = {{'x', 'x', 'x', 'x', 'x', 'x'}, {'x', 'x', 'x', 'x'}};
But the correct code will not:
char myName [6] [4] = {{'x', 'x', 'x', 'x', 'x', 'x'}, {'x', 'x', 'x', 'x'}};
Is there a reason that:
- the second array
[4]is being applied to the first set of characters? - the first array
[6]is being applied to the second set of characters?
I am using the most recent version of Xcode. Is there some sort of glitch where arrays are inverted or something? I've looked around but I can't find anything explaining this.