小编shi*_*arg的帖子

post和pre increment,c ++中的减量

#include <iostream>
using namespace std;

void f(int x, int y){

        cout << "x is " << x << endl;
        cout << "y is " << y << endl;
}



int main(){

        int i = 7;
        f(i--,i-- );
        cout << i << endl<< endl;
}
Run Code Online (Sandbox Code Playgroud)

我们预计程序打印"x是7 \ny是6 \ni是5"

但程序打印"x是6 \ny是7 \ni是5"

c++

6
推荐指数
1
解决办法
612
查看次数

标签 统计

c++ ×1