题目内容

以下函数的功能是从名为"filea.dat"的文本文件中逐个读入字符并显示在屏幕上。 #include<stdio.h> main() {FILE *fp;char ch; fp=fopen("filea.dat","r"); ______; /*第一空*/ while(______(fp));{putchar(ch);ch=______;}/*第二、三空*/ putchar(’\n’);fclose(fp); }

查看答案
更多问题

采用递归调用的算法编写一个计算x的n次方的函数(主函数调用省略)。

下列函数的主要功能是在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的其他两种形式,它们是______和______。

答案查题题库