
c/c++
Twent
这个作者很懒,什么都没留下…
展开
-
这是怎么回事?
看了一下Standard C Library的一些源码,照着实现了一个 char* strcat(char* s1,const char* s2)函数,测试一下main(){ char* s1="abce"; char* s2="efgh"; char* s3=strcat(s1,s2); printf("%s",s3);}编译时通过,运行时却出现错误 hand原创 2005-09-29 17:57:00 · 4787 阅读 · 0 评论 -
typedef keyword in c/c++
Every variable has a data type. typedef is used to define new data type names to make a program more readable to the programmer. For example: int money; money = 2;原创 2005-10-08 13:41:00 · 1895 阅读 · 0 评论 -
指针作为函数参数传递
值传递, 指针传递?这几天在学习C过程中,在使用指针作为函数参数传递的时候出现了问题,根本不知道从何得解:源代码如下: createNode(BinNode *tree,char *p) { tree = (BinNode *) malloc(sizeof(BinNode)); tree->data = *p; }该代码段的意图是通过一个函数创建一个二原创 2005-10-10 16:35:00 · 11850 阅读 · 4 评论