一起答
单选

如果打开文件时,选用的文件操作方式是"wb+"则下列说法中正确的是( )

  • A.要打开的文件必须存在
  • B.打开文件后只能渎数据
  • C.文件打开后删除原内容再写
  • D.打开文件后只能写数据
参考答案
查看试卷详情
相关试题
  1. 输入一个无符号整数,然后按用户输入的代号,分别以十进制(代号D)、八进制(代号O)输出和十六进制(代号X)。

  2. 输入2个整数,输出它们的最小公倍数和最大公约数。

    #include<stdio.h>

    void main()

    {int m,n,gbs,gys;

    scanf("%d,9/6d",m,n);

    gbs=m;

    while(______)/*第一空*/

    gbs=______;/*第二空*/

    gys=______;/*第三空*/

    printf("%d %d\n",gbs,gys);

    }

  3. 下面程序由终端键盘输入一个文件名。然后把从终端键盘输入的字符依次存放到该文件中,用#作为结束输入的标志。

    #include<stdio.h>

    #include<stdlib.h>

    main()

    {FILE*fp;

    char ch,fname[10];

    printf("Please input the file name.\n");

    gets(fname);

    if((fp=______)==NULL)/*第一空*/

    {printf("()pen it error\n");______;}/*第二空*/

    else(printf("Enter the content\n");

    while((ch=getchar())!='#')

    ______;/*第三空*/

    }

    fclose(fp);

    }

  4. 下面rotate函数的功能是:将n行n列的矩阵A转置为A。

    #define N 4

    void rotate(int a[][N])

    {int i,j,t;

    for(i=0;i<N;I++)

    for(j=0;______;j++)/*第一空*/

    {t=a[i][j];

    ______;/*第二空*/

    a[j][i]=______;/*第三空*/

    }

    }

  5. #include<stdio.h>

    #include%<string.h>

    main()

    {char p1[10]="abc",p2[10]="ABC",str[50]="xyz":

    strcpy(str+2,strcat(p1,p2)):

    printf("%s\n",str);

    }

  6. #include<stdio.h>

    #include<string.h>

    main()

    {int y=9;

    for(;y>0;y--)

    {if(y%03==0)

    {printf("%d",--y);continue;}

    printf("%d",--y);

    }

    }

  7. #include<stdio.h>

    int ast(int x,int y,int *cp,int *dp)

    {*cp=x+y;*dp=x-y;}

    main()

    {int a,b,c,d;

    a=4;b=3;

    ast(a,b,&C,&d);

    printf("%d,%d\n",c,d);

    }

  8. 设a、b、c为整型数,且a=2、b=3、c=4;则执行完下列语句后a的值是______。

    a*=16+(b++)-(++c);

  9. #inclucde<stdio.h>

    void prly(int *x)

    {prinlf("%d\n",++*x);}

    main()

    {int a=25;

    prty(&a):

    printf("%d\n",a):

    }