What are some C++ related idioms, misconceptions, and gotchas that you\'ve learnt from experience?
An example:
class A
{
public:
char s[1024];
cha
Nothing I actually came across while programming, but a friend wanted an explanation on why the code worked. It took me a while to figure it out. Maybe it is obvious to you guys, but I am not an experienced programmer.
#include
using namespace std;
int& strangeFunction(int& x){return x;}
int main(){
int a=0;
strangeFunction(a) = 5; //<------- I found this very confusing
cout << a <