自增自减

int b=8;
int c=0;
c=++b;
cout<<"c="<<c<<endl;
cout<<"b="<<b<<endl;
结果为:c=9;b=9;
int b=8;
int c=0;
c=b++;
cout<<"c="<<c<<endl;
cout<<"b="<<b<<endl;
结果为:c=8;b=9;
int b=8;
int c=0;
c=--b;
cout<<"c="<<c<<endl;
cout<<"b="<<b<<endl;
结果为:c=7;b=7;
int b=8;
int c=0;
c=b--;
cout<<"c="<<c<<endl;
cout<<"b="<<b<<endl;
结果为:c=8;b=7;
posted @ 2019-10-15 11:26  tangjunjun  阅读(139)  评论(0编辑  收藏  举报
https://rpc.cnblogs.com/metaweblog/tangjunjun