对下面程序描述正确的是( )。 #include <stdio.h> #include <stdlib.h> void main() {FILE *in,*out; if((in=fopen("file1.txt","a+"))==NULL) {printf("cannot open file1\n"); exit(0); } if((out=fopen("file2.txt","a+"))==NULL) {printf("cannot open file2\n"); exit(0); } while(!feof(out)) fputc(fgetc(out),in); fclose(in); fclose(out); }
若按如下定义,函数link的功能是( )。其中head指向链表首结点,整个链表结构如下图: ┌──┬─┐ ┌──┬─┐ ┌──┬──┐ head →│data│ ┼→│data│ ┼→…→│data│NULL│ └──┴─┘ └──┴─┘ └──┴──┘ struct node {int data; struct node *next; }; void link(struct node* head) {struct node *p=head; while(p!=NULL) { if(p->data%2==1) printf("%d ",p->data); p=p->next; } }