首页/ 题库 / [单选题]有以下定义: #include <std的答案

有以下定义: #include <stdio.h> char a[10], *b=a; 下面不能给数组a输入字符串的语句是( )。

单选题
2023-03-06 04:48
A、gets(a)
B、gets(a[0]);
C、gets(&a[0]);
D、gets(b);
查看答案

正确答案
B

试题解析
解析:函数gets(字符数组)的功能是从终端输入一个字符串到字符数组,并且得到一个函数值,该函数值是字符数组的起始地址。函数的参数应该是一个指针,所以选项B)错误。

标签:
感兴趣题目
有以下程序: #include<stdio.h> main( ) { char a=H; a=(a>=Aa<=2)?(a-A+a):a; printf("%c ",a); } 程序运行后的输出结果是( )。
有以下程序: #include <stdio.h> main( ) { int a=2,b; b=a<<2;printf("%d ",b); } 程序运行后的输出结果是( )。
有以下定义: #include <stdio.h> char a[10],*b=a; 不能给数组a输入字符串的语句是( )。
有以下定义#include <stdio.h>char a[10],*b=a;不能给a数组输入字符串的语句是
有以下定义: #include <stdio.h> char a[10],*b=a; 不能给数组a输入字符串的语句是
下列程序的输出结果是( )。 #include<stdio.h> #include<string.h> main() { char a[]=" 123\"; printf("%d,%d ",strlen(a),sizeof(a)); }
有以下程序: #include <stdio. h> main( ) { unsigned int a; int b=-1; a=b; printf(" % u", a);程序运行后的输出结果是( )。
有以下程序 #include<stdio.h> void main() { int a=1,b=0; printf("%d,",b=(a++)+(a++)); pfintf("%d ",a+B); } 程序运行后的输出结果是( )。
有以下定义: # include<stdio.h> char a[l0],*b=a; 不能给a数组输入字符串的语句是 ______。
有以下定义: #include <stdio.h> char a[10], *b=a; 下面不能给数组a输入字符串的语句是( )。
有以下程序: #include<stdio.h> main() { int a=1,b=2,c=3,x; x=(a^B)&c;printf("%d ",x); } 程序的运行结果是( )。
以下程序的输出结果是( )。 #include <stdio.h> main() { int a=21,b=11; printf("%d ",--a+b,--b+a); }
相关题目
阅读下面程序段,则执行后输出的结果是
#include "stdio.h"
main()
{ char fun(char,int);
char a=′A′;
int b=13;
a=fun(a,b);
putchar(a);}
char fun(char a,int b)
{char k;
k=a+b;
return k;}
下面程序的运行结果是( )。 #include <stdio.h> main() { int a=1,b=10; do {b-=a;a++;}while(b--<0); printf("a=%d,b=%d ",a,b); }
有以下定义:char a[10],*p=a;不能给数组a输入字符串的语句是( )。
有以下程序 #include<stdio.h> main( ) {char a[3O],b[30]; scanf("%S",a); gets(b); printf("%s %s\n",a,b); } 程序运行时若输入: how are you? I am fine<回车> 则输出结果是( )。
有以下程序: #include<stdio.h> void fun(char**p) { ++P;printf("%s ",*p);} main() char*a[]={"Morning","Afternoon","Evening","Night"}; fun(A); } 程序的运行结果是( )。
有以下程序 #include<stdio.h> void fun(char**p) {++p;printf("%s",*p);} main {char*a[]={"Morning","Afternoon","Evening"," Night"); fun(a); } 程序的运行结果是( )。
下述程序的输出结果是( )。 #include<stdio.h> void main() {char a=1,b=2; char c=a^b<<2; printf(" %d",C); }
下述程序的输出结果是( )。 #include<stdio.h> void main() {char a=3,b=1; char c=a^b<<2; printf("%d",C; }
请读程序: # includde<stdio.h> # include<string.> void fun(char * s) {char a[10]; strcpy(a,"STRING"); s=a; } main() { char*p; fun(p); print{("%s ",p); } 上面程序的输出结果(表示空格) ( )
以下程序的输出结果是 ( ) #include<stdio.h> main() {struct stru{int a,b: char c[6]; }: printf("%d ",sizeof(stru)), }
有以下程序:#include main(){ char s[10] = verygood, *ps = s; ps += 4; ps = nice; puts(s);}程序的运行结果是(  )。
有以下程序:#include #include main(){ char a[20]=ab,b[20]=cdef; int k=0; strcat(a,b); while(a[k]!='\0') {  b[k]=a[k];  k++; } puts(b);}程序的运行结果是(  )。
有以下程序#include void  fun(char *a, char *b){ while(*a=='*') a++; while(*b=*a) {  b++;  a++; }}main(){ char *s=*****a*b**** , t[80]; fun(s,t); puts(t);}程序的运行结果是(  )。
有以下程序:#include#includemain(){ char w[20],a[5][10]={abcdef,ghijkl,mnopq,rstuv,wxyz.}; int i; for(i=0;i<5;i++)w[i]=a[i][strlen(a[i])-1]; w[5]='\0'; puts(w);}程序的运行结果是(  )。
有以下程序: #include  main() {  char a[30],b[30];  scanf(%s,a);  gets(b);  printf(%s%s,a,b); } 程序运行时若输入: how are you?I am fine<回车> 则输出结果是(  )。
有以下程序:#include main(){ int a=3; int b=3; printf(%d, a&b);}程序运行后的输出结果是(  )。
有以下程序:#include int fun(int a,int b){ if(b==0)return a; else return(fun(--a,--b));}main(){ printf(%d,fun(4,2));}程序运行的结果是(  )。
有以下程序: #include<stdio.h> main( ) { int a=-2,b=0; while(a++++b); printf("%d,%d ",a,b); } 程序运行后的输出结果是( )。
有以下程序:#include #include #include main(){ char*p1,*p2; p1=p2=(char*)malloc(sizeof(char)*10); strcpy(p1,malloc); strcpy(p2,p1+1); printf(%c%c, p1[0], p2[0]);}程序的运行结果是(  )。
以下程序的运行结果是 ( ) # include<stdio.h> main( ) { int a=015,b=22; printf("%d,%d ",a+ +,- -b); }
广告位招租WX:84302438

免费的网站请分享给朋友吧