我不能真正undersdand後綴。我知道它首先使用標識符,然後增加或減少,如第一個顯示i
,然後++
。但現在我認爲我錯了,仍然不明白。後綴改變之前標識符?
#include <iostream>
using namespace std;
int main()
{
int i = 0;
cout << i << i++ << i;
cout << "\n\n\nPress Enter to close the window . . . ";
cin.clear();
cin.sync();
cin.get();
return 0;
}
輸出:
101
Press Enter to close the window . . .
第一i
是增量readed.Why之前改變了嗎?
我預計
001
Press Enter to close the window . . .
誰能解釋。
謝謝你去看看 –
你是否真的在接受答案之前閱讀了標記副本中的任何答案?因爲你接受的答案顯然是不正確的。 –