Lets break this down:
printf("%c",3["abcde"]);
The printf
prints the data with a certain format.
The format is %c
, so the output is going to be a single character.
The character that is printing is 3["abcde"]
. The "abcde"
is an array of characters, and the one being accessed is the 4th letter. This is because arrays start at 0. In this case 'a' is character 0, 'b' is character 1, and on until 'e' which is 4.
To access the 'b' it would be 1["abcde"]
.
Note: 3["abcde"]
is the same as writing "abcde"[3]
and in both cases are equal to the character 'd'