I want to use M_PI as the constant for 3.141592blabla, but while Code::Blocks understands it, Microsoft Visual Studio doesn't. I've tried including these:
1 2
#include <cmath>
#include <math.h>
and it still says: "Error: identifier 'M_PI' is undefined"
#define is still needed in C++ to control #ifdef conditional compilation by the preprocessor phase of compilation. That said, the need for conditional compilation is certainly a lot less in C++.
What your instructor is advising is that #define are not the proper way to define constants.