C语言复习

算术表达式优先级数值越小,顺序越先,等优先级从左到右算;

算数表达式的变量必须有确定的值;

赋值表达式的结合顺序是从右到左;

强制转换的时候,转换类型必须有小括号();

逗号表达式的结合顺序是从左到右;

035是八进制的整形常量(一般8进制整形都是0开头)

0xla是十六进制整形常量(一般16进制整形都是0x开头)

赋值运算符顺序从右到左;

void main()
{
printf("%d\n",-2147483648-1);
printf("%d",2147483647+5);
}
//输出1.2147483647
//      2.-2147483648
需要再 深入理解溢出的原理

#include <stdio.h>
void main()
{
int a=10,b=3;
a=(double)a/b;
printf("a=%d,%lf,b=%d",a,a,b);

}
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYgAAAAuCAYAAAAycY5hAAAVuklEQVR4Ae2dTahs2VXHT1W9R9vQGBTbdhJwEEQhE8GJhGBn4NC5EwOBICo4yMRMnBpxGuJMhaAOHCtkYJAexDT0UA0hhKCToPkSggM/+laV/99/7XXOrnNPnVO37q37ufd9VXvv9b3+e5+165y6773VP/37h/vVatXR9vu9e96+8fWvdD/zUx/p5+PBer3ueO22225X6f3ghz/qPvpLv9K9/bM/J/6qW3WyaT62GXfSuer2O+ntdup3lllJNpp0sK2YVuuNe9uXjd1e8upXP/hq97lf/nb3O9/9ve4XVym7th4e+VPeis1R5zD2tkVou+2+217tuu1OPjTeqd8z1utbX/7p7i9+/pvdFz75jmPPHKRWWsQdEBJzZ1zInZTWG8X3at1t1G82q26jcTHkMOWpu7r6UP6v+n4LNld6CSfG629/ufvVDz7RffCZj8vmuvvPr/1u9+uf3Xdfev/Pu0++s448ALb7fve13/9496+//d3uN3+BfLbG1/3++937f/CJ7vN/n3GX/lNf7P7mj36te/vVa8X2unulVwf28sM6ML768EPFRnz/1201Zg3AjdgZrDevpKuXesbsJ9Yv7WQc3iusOesIvnvFh77WGd3NRuuNDfyX/SWmea9kn/2w2bxWD+YRmyayozV0POoVUz8vdPNqGRE09cspVJD4GnB+SERjn9LMC1L/fo0GMKVd4yVDfUQwEOZkwbh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y4mWsINAQaAg2Bp41AOyCe9vq16BsCDYGGwMUQaAfExaBthhsCDYGGwNNGQP8n9dNOoEXfEGgINAQaApdB4OAOgl9mqn6h6TIem9WGQEOgIdAQeBII9AdEOxiexHq1IBsCDYGGwL0h4AOiHQ73hndz1BBoCDQEngwC/ue+668h6vGTyaIF2hBoCDQEGgJ3jkD/iOnOLTeDDYGGQEOgIfCkEWgHxJNevhZ8Q6Ah0BC4HALtgLgcts1yQ6Ah0BB40gj8P/J1JCDioayRAAAAAElFTkSuQmCC" alt="" />
为什么会这样?
<pre name="code" class="cpp">scanf("a=%3d",&a);
在读取时,需要同时把“a=”打上;否则赋值不了

 getche();//输入显示不等待 

getch();输入不显示也不等待(注:直接用getch();不赋值可以实现分屏显示)

getchar();输入显示等待

字符输入时需要注意空格也是一个字符!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值