0
在我的系統centos7.0, 當我編譯使用g ++ TEST.CPP -o測試, 輸出 「是Linux系統」克++在C11編譯器宏
當編譯使用g ++ TEST.CPP代碼-std = C++ 11 -o test 輸出是「不是linux系統」
爲什麼在c11中編譯器的默認宏改變了?
TEST.CPP
#include <iostream>
using namespace std;
int main(){
#ifdef linux
cout<<"is linux system\n";
#else
cout<<"is not linux system\n";
#endif
return 0;
}