C++中++i与i++
2024-10-10 21:37:09
#include "stdafx.h"
#include "string"
#include "iostream"
#include "vector"
#include "sstream"
using namespace std; int _tmain(int argc, _TCHAR* argv[])
{
//前置版本,将运算对象+1,然后将改变后的对象作为求值结果
int j=;
int i=;
j=++i;
cout<<"i="<<i<<endl; //i=11
cout<<"j="<<j<<endl; //j=11 //后置版本,将运算对象+1,但是求值结果是运算对象改变之前结果的的副本
int j1=;
int i1=;
j1=i1++;
cout<<"i1="<<i1<<endl; //i=11
cout<<"j1="<<j1; //j=10 getchar();
return ;
}
最新文章
- 使用python解析Json字符串-获取Json字符串关键字
- Entity Framework 6 执行Linq to Entities异常";p__linq__1 : String truncation: max=0, len=2, value=&#39;测试&#39;";
- Oracle修改默认字符编码
- Matlab里面的SVM
- C# 自定义序列化问题
- android 定制目录
- C++ code Summary --- 2015.11.8
- Leetcode#71 Simplify Path
- 【Cocos2d入门教程五】Cocos2d-x动作篇
- shell 基础 $(cd `dirname $0`;pwd)
- linux sudo环境变量设置
- Oracle多关键字查询
- PrefixHeader.pch&#39; file not found 以及 Xcode 中如何添加pch文件
- Quartz 原理
- 乐视4.14硬件免费日de用户体验
- Linux命令(九)比较文件差异 diff
- 从内存中加载DLL DELPHI版
- PHP关于=>;和->;以及::的用法
- word中拷贝图片到matlab
- Windows7下安装配置PostgreSQL10