這段代碼可以在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;
}
爲什麼你認爲它應該編譯失敗? –