Although I use std::vector
almost all the time, I am interested in understanding as much as I can about pointers. Examples of what I am talking about:
Not just pointers and arrays: How to interpret complex C/C++ declarations:
Start reading the declaration from the innermost parentheses, go right, and then go left. When you encounter parentheses, the direction should be reversed. Once everything in the parentheses has been parsed, jump out of it. Continue till the whole declaration has been parsed.
One small change to the right-left rule: When you start reading the declaration for the first time, you have to start from the identifier, and not the innermost parentheses.
You example:
char* array[5];
Is an array of 5 pointers to char.