Example code for character array in C:
What is the output of below C program?
char ch = "skill";
crash at run time or may be some garbage.
In this given example instead of mentioning ch, we have mentioned 2[ch]. But both are same pointing to 2nd index. ch is equal to *(ch+2). And 2[ch] is equal to *(2+ch). So logically both are same. so it prints "i".
Back To Top