2009年11月12日

指针数组探讨

摘要: 首先来看普通的数组: int a[2] = {1,2};这是强调下a是数组的地址,即a = =&a[0];下面来看指针数组char *p[2];char *p1="aaa";char *p2="bbb";char *tmp;p[0] = p1;p[1] = p2;这里p是数组名,所以p是整个数组的地址,即p = &p[0];p+1 = &p[1];大家可能经常看到tmp =... 阅读全文

posted @ 2009-11-12 19:45 寂寞的肥肉 阅读(1531) 评论(10) 推荐(2) 编辑

深入int getc(FILE *fp),putc(int c, FILE *fp),int getchar(void),int putchar(int c)

摘要: 这几个其实都不是函数,仅仅是在stdio.h头文件中定义的宏#define getc(_stream) (--(_stream)->_cnt >= 0 \? 0xff & *(_stream)->_ptr++ : _filbuf(_stream))#define putc(_c,_stream) (--(_stream)->_cnt >= 0 \? 0xff ... 阅读全文

posted @ 2009-11-12 19:44 寂寞的肥肉 阅读(1556) 评论(0) 推荐(0) 编辑

导航