How can you tell in your preprocessing code if the program is being compiled in windows or in linux or in any other system if you would like to know that?
How can you tell in your preprocessing code if the program is being compiled in windows or in linux or in any other system if you would like to know that?
Yes, there are several #defines that you can check for with #ifdef to see what system is running and define the appropriate code depending on that. I don't know exact examples, right now, though.
...how about this:Code:#include <stdio.h> #ifdef WIN32 #define str "This is 32bit Windows" #else #define str "This is some other OS" #endif int main() { printf("%s",str); }
Last edited by SlyMaelstrom; 07-21-2006 at 06:35 PM.
Sent from my iPadŽ
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*