為什么以下輸出結果是
3 ++
2 --
```cpp
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
int f1() {
static int a = 1;
a += 1;
return a;
}
int main() {
cout << f1() << " ++ " << endl << f1() << " --" << endl;
}
```
uj5u.com熱心網友回復:
運算式求值順序未定義。建議:int x=f1();
int y=f1();
cout。。。。。。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/32453.html
標籤:基礎類
上一篇:C語言如何嵌套回圈列印直角三角形
下一篇:求大佬幫一下 C++基礎
