1.
bug#7180
相关:7195 7196 7224 7234
2.
GDB调试
http://www.cnblogs.com/rosesmall/archive/2012/04/12/2444431.html
include<stdio.h>
//int mystrlen(const char a[])
int mystrlen(const char *a)
{
if(*a == '\0'){
printf("this is a comment\n");
return 0;
}
else {
printf("call myself\n");
return 1 + mystrlen(a+1);
}
}
char *mystrcpy(char *dst, char *src)
{
char *cp = dst;
while((*cp++ = *src++))
;
return dst;
}
char *mystrcat(char *dst, char *src)
{
char *cp = dst;
while(*cp)
cp++;
while((*cp++ = *src++))
;
return dst;
}
int main(void)
{
char buf[32];
//char *ch = "acdefgh";
//printf("%d\n", mystrlen("test"));
printf("%s\n", mystrcpy(buf, "I love abc"));
//printf("%s\n", mystrcat(buf, "ok ?"));
/*printf("%c\n", *ch);
ch++;
printf("%c\n", *ch++);
*/return 0;
}