So, the first line is assigning a to the first place in the array "foo", |
Correct.
and the second line doesn't make sense to me. |
The second line assigns 75 to the a'th entry in foo.
You don't give a type or value for a, but let's assume it's an int with a value of 10.
Then the second line assign 75 to foo[10].
but how can character 'a' be a place in array? |
Again, you haven't shown the definition of a, so I can only assume what it might be.
There is a difference between a and 'a'. a is a variable. 'a' is a character literal.
Even if the declaration is:
a would still be treated as integer type capable of holding a number from -127 to + 127.
The fourth line takes the value in foo[2] and adds 5. The value in foo[a] is then used as a subscript into foo to store the result of the calculation on the right side.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.