What are some C++ related idioms, misconceptions, and gotchas that you\'ve learnt from experience?
An example:
class A { public: char s[1024]; cha
Here is another one i caught some day:
char int2hex(int x) { return "-0123456789abcdef"[(x >= 0 && x < 16) ? (x + 1) : 0]; }
it's just indexing the char array instead of doing a switch. If it's outside the range, it returns '-'.