摘要: 正确使用Swap函数交换两数:#include void Swap(int *p1,int *p2){ int tmp = *p1; *p1 = *p2; *p2 = tmp;}int main(){ int a = 10; int b = 20; Swap(&a... 阅读全文
posted @ 2015-03-19 19:45 吴沫 阅读(578) 评论(0) 推荐(0)
摘要: char *strcpy(char *s1,const char *s2);把s2指向的字符串,包括空字符复制到s1指向的位置,返回值是s1.char *strncpy(char *s1,const char *s2,size_t n);把s2指向的字符串复制n个字符到s1指向的位置,返回值为s1.... 阅读全文
posted @ 2015-02-06 16:48 吴沫 阅读(452) 评论(0) 推荐(0)
摘要: strcpy函数功能:char *strcpy(char *str1,char *str2),把字符串2复制到字符串1。源码:char *strcpy(char *str1,char *str2){ assert(str1 != NULL && str2 != NULL); char *p = st... 阅读全文
posted @ 2015-02-05 22:43 吴沫 阅读(228) 评论(0) 推荐(0)
摘要: eg:9.7 有n个结构体变量,内含学生学号,姓名和3门课成绩,要求输出平均成绩最高的学生的信息(内含学生学号,姓名和3门课成绩和平均成绩)。2015-01-2022:25:34 1 #include 2 #define N 2 3 4 struct Student 5 { 6 int n... 阅读全文
posted @ 2015-01-20 22:24 吴沫 阅读(145) 评论(0) 推荐(0)