Can anyone help me with this?
I'm self-teaching myself C++, and browsing the original CtP2 source code files
I understand '#if' statements when they relate to #defined names but keep coming across '#if 0' and '#if 1' (Player.cpp even contains a '#if 0 - #endif' embedded in another '#if 0 - #endif'). As no field is being tested for a value of 0 or 1
just what does this code check?
Txs in advance
PS Martin G, thanks for your advice. I've managed to pick up an unused copy of VS6 on eBay, which I'm also now learning about.
I'm self-teaching myself C++, and browsing the original CtP2 source code files
I understand '#if' statements when they relate to #defined names but keep coming across '#if 0' and '#if 1' (Player.cpp even contains a '#if 0 - #endif' embedded in another '#if 0 - #endif'). As no field is being tested for a value of 0 or 1
just what does this code check?Txs in advance
PS Martin G, thanks for your advice. I've managed to pick up an unused copy of VS6 on eBay, which I'm also now learning about.
that the C++ compiler can recognise and ignore duplicated Includes.
Back in the days of C (no ++) there was no boolean data type, and in the conditional statements, 0 meant false and anything else (including 1) meant true. Therefore, if you write something like if (0) { ... } then the statements in curly braces denoted by ... will never execute, and if you wrote if (1) { ... } then it will always execute.
Comment