請解釋爲什麼以下程序的輸出是1?請解釋爲什麼以下程序的輸出是1?
#include <iostream>
using namespace std;
int main()
{ //Explain me why the output of the following program is 1 ?
cout << "Hello world!" << endl;
int y=1, x=0;
int p=(y++,x++)?y:x ;
cout<<p;
return 0;
}
也有幫助閱讀:[逗號運算符](http://en.cppreference.com/w/cpp/language/operator_other#Built -in_comma_operator)用@ KenY-N標記的dupe鏈接,你應該能夠弄清楚發生了什麼。 – user4581301
向我們解釋你爲什麼認爲它不應該是'1' – Tas