自己写的strcat,运行会有问题,⊙⊙?#include <stdio.h>void strcat(char *s,char *t){ while(*s) //c中null可以代替0 s++; while(*s++=*t++) ;}int main(){ char s[] = "Hello "; char t[] = "World!"; //char *s = "Hello"; //指针,不能修改里面的内容 //char *t = "World"; char *p = s; strcat(p,t); Read More
posted @ 2012-01-30 21:00 zwein Views(153) Comments(0) Diggs(0)
printf:int _cdecl printf(const char*format,...);_cdecl 是C和C++程序的缺省调用方式。1.参数从右到左依次入栈2.调用者负责清理堆栈3.参数的数量类型不会导致编译阶段的错误__cdecl 是C DECLaration的缩写(declaration,声明),表示C语言默认的函数调用方法:所有参数从右到左依次入栈,这些参数由调用者清除,称为 手动清栈。被调用函数不会要求调用者传递多少参数,调用者传递过多或者过少的参数,甚至完全不同的参数都不会产生编译阶段的错误。 Read More
posted @ 2012-01-30 20:08 zwein Views(111) Comments(0) Diggs(0)