C++ has great features. And dangerous ones. Consider this piece of code:
#include <iostream> using namespace std; #define sizeof(x) __LINE__*4 int main(void) { cout << sizeof(int) << endl; cout << sizeof(int) << endl; }
This code is perfectly valid and prints 32 and 36. This error should be extremely hard to debug…