摘要:
第一章1. = 不等于 ==2. & | 不同于 && ||3. 词法分析中的贪心法a---b与a-- - b的含义一样c语言词法分析规则:每个符号应该包含尽可能多的字符,也即:从左到右一个字符一个字符的读入,如果该字符可能组成一个符号,那么再读入下一个字符,如果不能则停止,将已经读入的可以构成运算符的几个字符作为一个运算符。a+++++b的意义是a++ ++ + b 虽然词法分析是这样,但是a++ 不可以作为++运算的左值,所以这个表达式编译会报错。4. 整型常量如果第一个字符数字是0,那么该常量被视作八进制。5. C语言中,单引号括起来的字符实际上代表一个整数,也就 阅读全文
posted @ 2009-06-19 09:23
小 楼 一 夜 听 春 雨
阅读(189)
评论(0)
推荐(0)
摘要:
先看一个例子:char* GetMemory(int num){ return new char[num];}int main(){ char* str = GetMemory(10); char tmp[10]; /* 虽然str和tmp的空间大小都为10,但是: The strcpy function copies strSource, including the terminating null character, to the location specified by strDestination. No overflow checking is performed whe... 阅读全文
posted @ 2009-06-19 09:12
小 楼 一 夜 听 春 雨
阅读(265)
评论(0)
推荐(0)

浙公网安备 33010602011771号