I am not very expert in cpp programming, rather a beginner in the enormous world of programming, as these days we just install any IDE and start with our programs in it. I started using CodeBlocks IDE but just out of curiosity wanted to know which compiler is my program using as it can be 4.3.2 or 4.0.8 or maybe something else
I tried reading through the Build logs it wasn’t there, a small google did not help either.
Is there any simple command which i can run in my cpp progam and check which compiler my IDE is using?
Thanks in advance.
You can use the macros
See http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
Other compilers provide their own macros, for example Microsoft’s
_MSC_VERHere’s a very comprehensive list covering dozens of compilers: http://predef.sourceforge.net/precomp.html and http://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers