过网而居,点点滴滴

我的IT日记------冲刺流星 isaacct@163.com

IT博客 联系 聚合 管理
  13 Posts :: 0 Stories :: 2 Comments :: 0 Trackbacks
1。printf("abc") will output a string " abc ",and the then a prompt like "%" or ">".Sometimes  "\n" is necessary,it can avoid many unbelievable ERROR...

2. a---b can be explained as a-- -b,not a- --b,cause the priority of "--" is higher.

3.You'd better write x/*y as x/(*y),or maybe the compiler will take a /* as a notation.

4.对于printf("\n")是正确的格式,但写成了printf('\n')也会编译通过,而在运行时产生内存读取错误,在VC7.0的编译器下面,难道也不检查参数?

5。编译器如何处理以下语句:
printf("%d",'ab');是把'ab\0'的二进制代码处理为十进制数值?
可是结果是24930,不知如何得到的。。。
在VC中的处理方法是确实按照 a的二进制 b的二进制 来进行的
ASCII字符是8位,a=97=01100001; b=98=01100010
那么就是ab=0110000101100010=24930

 
6。为什么a+++++b在VC7.0的编译器下通不过呢
是解释成(a++)++ +b  还是(a++)+(++b) ?
可是只有后者才能够编译。。。
为什么第一个就不行呢

posted on 2006-11-01 16:14 冲刺流星 阅读(60) 评论(0)  编辑 收藏 引用
只有注册用户登录后才能发表评论。