下列函数的主要功能是在w指向的数组的前*n个数据中插入x,要求w指向的数组的前*n个数据按由小到大顺序存放。插入x后,该数组中的数据仍按照从小到大的顺序排列,同时将*n修改为插入x后的长度。 void f(char *w,char x,int *n) {int i,p=0; w[*n]=x; while(x>w[p])______; /*第一空*/ for(i=*n;i>p;i--)w[i]=______;/*第二空*/ w[p]=x; ______; /*第三空*/ }
查看答案
struct stu {int num; char name[10]; int age }; void py(struct stu *p) {printf("%s\n",(*p).name);} main() {struct stu student[3]={{1001,"Sun",25}, {1002,"Ling",23}, {1003,"Shen",22}}; py(student+1); }
已知: struct{int day;char month;int year;}a,*b,b=&a;可用a.day引用结构体中的成员day,请写出通过指针变量b引用成员a.day的其他两种形式,它们是______和______。
设有定义:int a[5]={4,8};则a[0]=______,a[3]=______。