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?
Printable View
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);
}