Can any of known compilers output the result of pre pocessor?
For example:Result will beCode:#define d #ifdef d cout<<"ok"; #else cout<<"no"; #end if
Code:cout<<"ok";
Can any of known compilers output the result of pre pocessor?
For example:Result will beCode:#define d #ifdef d cout<<"ok"; #else cout<<"no"; #end if
Code:cout<<"ok";
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C
Yes, you could run something like this through the pre-compiler:
$ g++ -E foo.cc > output.txtCode:#define d #ifdef d #define STR "OK" #else #define STR "" #endif #include <iostream> int main ( ) { std::cout << STR; }
It dumps a whole lot of stuff though, the standard header files are gigantic. You could do something clever to avoid it I suppose.
Last edited by whiteflags; 08-11-2006 at 04:58 PM.
It is exactly what I want. I want to see all includes in one file.It dumps a whole lot of stuff though, the standard header files are gigantic.
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C
Anyway, it would just be a matter of reading your compiler's documentation to find out what switch you need to use and then writing a file that lets you see what you want to see.
Yes, it is exactly what I am doing. I didn't find any swtch in IDE options though and I am hopless.Originally Posted by citizen
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C
I found it. I don't know why I didn't see it before. It is /P in my compiler.
Thank you.
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C