A constant is an identifier, not a string literal (string literals have double quotes around them, identifiers do not).
A constant value, on the other hand, is a string literal, not an identifier. You need to switch it like this:
#ifdef __unix__
# define CLRSCR "clear"
#elif defined _WIN32
# define CLRSCR "cls"
#endif
int main(){
system(CLRSCR);
}
source
share