摘要: 9.1 把一个学生的信息(包括学号、姓名、性别、住址)放在一个结构体变量中,然后输出这个学生的信息。 复制代码 #include int main() { struct student { long int num; char name[20]; char sex; char addr[20]; }a = {... 阅读全文
posted @ 2017-04-08 19:23 心动&动心 阅读(210) 评论(0) 推荐(0) 编辑
摘要: #include int main() { void fun(int a[10]); int a[10]={1,2,3,4,5,6,7,8,9,10}; } void fun(int a[]) { int i; int *p; p=&a[i]; for(i=0;i<=9;i++) prin... 阅读全文
posted @ 2017-04-04 13:17 心动&动心 阅读(219) 评论(0) 推荐(0) 编辑
摘要: #include main() {char funstr(char* str); char str [11]="helloworld"; printf("%s\n",str); str[0]='H'; str[6]='w'; puts(str); getchar(); funstr(str);} char funstr(char* str) {int i=0; printf("%s\n... 阅读全文
posted @ 2017-04-04 13:17 心动&动心 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 1. void swap(int *p,int *q) {int *temp; *temp=*p; *p=*q; *q=*temp; }不能实现交换的原因:*p就是整型变量,而*temp是指针变量temp所指向的变量,但temp无确定值,因此temp所指向的单元室不可预见的。所以对*temp赋值有可 阅读全文
posted @ 2017-03-26 10:45 心动&动心 阅读(121) 评论(0) 推荐(0) 编辑
摘要: #include int main() { void swap(int *p,int *q); int a,b,*p1,*p2; scanf( "%d%d",&a,&b); p1=&a;p2=&b; if(a<b) swap(p1,p2); printf("\n%d,%d\n",a,b); printf("\n"); } void s... 阅读全文
posted @ 2017-03-22 18:56 心动&动心 阅读(57) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int main () { int i, *p,int a[7]; 输入一个指针,一个长度为7的数组 *P=a; p=a; 将a的值附给p prinf("a[%d]=%d\n"i,*p); 输出p的值 } 2016024263 伍燕宽 阅读全文
posted @ 2017-03-18 21:58 心动&动心 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 我觉得老师所讲的内容我不了解,希望老师在课堂上能解释一下相关符号或是词语所代表的意思,讲仔细些。 2016024263 伍燕宽 阅读全文
posted @ 2017-03-18 10:35 心动&动心 阅读(111) 评论(0) 推荐(0) 编辑