2012年10月26日

揭露谭浩强的错误-证实不能用字符指针变量做实参

摘要: 谭浩强 《C程序设计第三版》 第255页 例10.19 有如下程序:功能是将a字符串复制到b,并输出两个字符串。#include<stdlib.h>#include<stdio.h>void copy_string(char *from,char *to){ for(;*from!='\0';) *to++=*from++; *to='\0'; }int main(){char *a="I am teacher.";char *b="you are a student.";printf(" 阅读全文

posted @ 2012-10-26 14:50 天涯古人 阅读(469) 评论(0) 推荐(0) 编辑

导航