p++ ++p
1.P++是先使用这个变量,使用完了再加1,你的例子就是,先输出,再加一
++P是先加一,在使用变量 eg:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include <stdio.h>//just change simplevoid stop(void){ system("pause"); }int main(void){ int i = 1; printf("i++ = %d\n",i++); printf("i = %d\n",i); int j = 1; printf("++j = %d\n",++j); printf("j = %d\n",j); printf("i++ = : %d ++i = %d\n",i++,++i); printf("i = %d\n",i); printf("++j = : %d j++ = %d\n",++j,j++); printf("j = %d\n",j); stop(); return 0;} |
运行结果:

1 i++ = 1
2 i = 2
3 ++j = 2
4 j = 2
5 i++ = : 3 ++i = 3
6 i = 4
7 ++j = : 4 j++ = 2
8 j = 4
%a,%A 读入一个浮点值(仅C99有效)
%c 读入一个字符
%d 读入十进制整数
%i 读入十进制,八进制,十六进制整数
%o 读入八进制整数
%x,%X 读入十六进制整数
%s 读入一个字符串,遇空格、制表符或换行符结束。
%f,%F,%e,%E,%g,%G 用来输入实数,可以用小数形式或指数形式输入。
%p 读入一个指针
%u 读入一个无符号十进制整数
%n 至此已读入值的等价字符数
%[] 扫描字符集合
%% 读%符号
随机推荐
- smoke
1.Have a smoke? 2.Would you like a cigarette? 3.Cigarettes? 4.Let's go have a smoke. 5.Do you smoke ...
- VirtualBox网络配置
VirtualBox中有4中网络连接方式: NAT Bridged Adapter Internal Host-only Adapter VMWare中有三种,其实他跟VMWare 的网络连接方式都是 ...
- Levenshtein distance
https://en.wikipedia.org/wiki/Levenshtein_distance 验证码识别 图片中的二维码截取
- Ubuntu常用200条命令
查看软件xxx安装内容:dpkg -L xxx 查找软件库中的软件:apt-cache search 正则表达式 查找软件库中的软件:aptitude search 软件包 查找文件属于哪个包: ...
- ecshop支付时减库存方法
ecshop后台减少库存的时机默认只有下订单时和发货时,不能满足各种客户需求啊,要增加一个商家付款后就能减少库存,先解决方法如下 1. includes/inc_constant.php 文件 大约2 ...
- lua环境安装 转
curl -R -O http://www.lua.org/ftp/lua-5.2.2.tar.gz tar zxf lua-5.2.2.tar.gz cd lua-5.2.2 make linux ...
- C#中Attribute介绍
什么是特性? MSDN中定义为:公共语言运行时运行添加类似关键字的描述声明,叫做Attribute,它对程序中的元素进行标注,如类型.方法.字段和属性等.attribute和Microsoft.Net ...
- jQuery 遍历json数组的实现代码
<script type="text/javascript"> "}]; $(d1).each(function(){ alert(this.text+&qu ...
- [LeetCode]题解(python):045-Jump game II
题目来源 https://leetcode.com/problems/jump-game-ii/ Given an array of non-negative integers, you are in ...
- hdu1241 Oil Deposits
Oil Deposits Time Limit: 2000/1000 MS (Java/Others) ...