摘要:
1 #include<stdio.h> 2 #include<malloc.h> 3 struct stu 4 { 5 int data ; 6 struct stu *next ; 7 }; 8 struct stu *creat(int n) 9 {10 int i;11 struct stu *head,*p,*tail;12 head = (struct stu *)malloc(sizeof(struct stu));13 head->next = NULL;14 tail = head; 15 for(i = 1 ... 阅读全文
摘要:
指针做参数传递写出下面的函数,实现计算字符串长,字符串复制功能int strlen(char *s)void strcpy( char *s, char *t)贴出你的代码 1 #include<stdio.h> 2 int strlen(char *s) 3 { 4 int n = 0; 5 while(*s++!='\0') 6 { 7 n++; 8 } 9 return n;10 }11 void strcpy( char *s, char *t)12 {13 while((*t++=*s++)!='\0');14 }15 ... 阅读全文