Quote Originally Posted by Neftren View Post
Ahh, yes, the precedence bit. I typically avoid declaring multiple variables on one line, so I don't really have that problem. To each their own I suppose.
Yeah, when it comes to pointers, I usually do as well, but I felt like being prepared for when I want to do it one line.

Quote Originally Posted by Neftren View Post
Const is just one of those annoying keywords where I don't think anyone can really agree on what to do. I think most people prefer placing const before the type declaration, though off the top of my head, const should always be placed in such a way so as to modify the type to its immediate left (int const). I think this breaks on older compilers though. I haven't really tested it rigorously.
Yes, that seems about right, even though const int works as well. The unholy combination of const and pointers really messed up one of our lectures for a while. Our lecturer (a replacement that day, so it's kind of understandable) wrote the pointer stars together with the variable name rather than with the type (or stand-alone, for that matter), which meant that he couldn't figure out where to put the const keyword when trying to declare a constant pointer to a variable value. Since I by then had learned about how pointer stars acted in multiple declarations on a single line, I could figure out how to do it (by placing the const after the star) and make the example work.

It also annoys me slightly how both const and (especially) * are read from right to left. the utterly brilliant declaration char * * const * const x (auto-generated example taken from this site) gives you a constant pointer to a constant pointer to a pointer to a char. When I first saw it myself earlier today, I failed to grasp why the const keywords affected the pointers in that order, before I realised how it reads them right to left. Simple when you know it, but hard to realise on your own...