Q:

Get the values of macro expansion as understood by the compiler

I'm working with a code base that has a lot of macro that got defined and undefined and redefined all over the place.  The compiler surprisingly is still able to chew through them, so is there anyway to extract this kind of macro expansion result , i.e. 
MY_MACRO -> myFolder/myFile.cpp #266 float myFunc()

Is there  way to get this for both MSVC and GCC? 

A:

You can use gcc -E for GNU C/C++
For Visual Studio, you can use CL /EP /C myfile.cpp from a command prompt.