
please wait
const
rather than #define
. There's plenty of utilities I see used in C++ that came from C though. I could be wrong, but it seems that those who start in C++ eventually get better at coding and are more ready to use C in their code. If people like to accuse C++ of being dangerous though, well C is just as ( and to some more) tedious. I don't use C a whole lot but I have found it useful from time to time. I know a guy who's a hobbyist game programmer though, and he uses A LOT of C, even though he started out in C++.
#define
and const
, defines run the risk of adding hard to find bugs into you program due to them not having a type. It is better practice to use const instead due to them having a type. #include <cstdlib>
1.#define
and const
, actually a const is better to make constants that will actually be USED in you program, but define is still usable in conditional compilation.
|
|
/*...*/
would be better than using #ifdef
s