I am doing a group project that sometimes is going to be tested under Linux operating system but some function like
system("cls") only works on windows. I found a answer here says to use a header file:
then add this in the source file
I just want to check if there a easier way to do, I am using GCC compiler.
Thank you.
system("cls") only works on windows. I found a answer here says to use a header file:
Code:
// #define LINUX // #define WINDOWS // #define OSX
Code:
#ifdef LINUX char os[] = "Linux"; #else #ifdef WINDOWS char os[] = "Windows"; #else char os[] = "Mac OSX"; #endif #endif
Thank you.
Comment