5
I need to do a function to clean the C screen running on Windows, Mac and Linux. I thought to do a function that:
If the OS were Windows: system("cls");
If the OS was Linux or Mac: system("clear");
The problem is: How do I discover the computer’s operating system and how would these if
and else
?
Have a look http://nadeausoftware.com/articles/2012/01/c_tip_how_use_compiler_predefined_macros_detect_operating_system
– Bruno H.
I think you better create a program for each OS. If you are going to do everything together, it will get heavier and confusing.
– Francisco