摘要: 对c下的指针总有一种畏惧感,动不动就出现各种错误,先看一段程序吧:#include <stdio.h> #include <string.h> int main(void) { char *buf; //定义char指针 char *string = "hello "; //指向常量数据区的“hello”字符串 buf = string; //将指向常量的指针赋值 printf("buf=%s\n ", buf); strcpy(buf, "world"); ... 阅读全文
posted @ 2012-02-20 15:14 xiangzi888 阅读(5527) 评论(1) 推荐(1) 编辑