此代码将在 g++ 中正常工作和运行。我不知道为什么。它应该给出一个错误。
#include <iostream>
using namespace std;
int main(){
int x=9;
int y=6;
//note that there is extra backslash in the end of if statement
if(x==y)\
{
cout<<"x=y"<<endl;
}
//note that there is extra backslash in the end of if statement
if(x!=y)\
{
cout<<"x!=y"<<endl;
}
return 0;
}