更多"[单选题]有以下函数
int fun(char *x,char *y)"的相关试题:
[单选题]已定义以下函数
int fun(int *p)
{return *p;)
fun函数返回值是()。
A.不确定的值
B.一个整数
C.形参P中存放的值
D.形参P的地址值
[单选题]一个函数为void x(int,char ch=’a’),另一个函数为void x(int),则它们( )
A.不能在同一程序中定义
B.可以在同一程序中定义并可重载
C.可以在同一程序中定义,但不可以重载
D.以上说法均不正确
[单选题]设有如下函数定义:
int f(char *s)
{ char *p=s;
while(*p!='\0') p++;
return(p-s); }
如果在主程序中用下面的语句调用上述函数,则输出结果为()。
printf("%d\n",f("goodbey!"));
A.3
B.6
C.8
D.0
[单选题]有以下程序
fun(char p[][10])
{int n=0,i;
for(i=0;i<7;i++)
if(p[i][0]=='T')n++;
return n;
}
main()
{char str[][10]={"Mon","Tue","Wed","Thu","Fri","Sat","Sun"};
printf("%d\n",fun(str));
}
程序执行后的输出结果是()。
A.1
B.2
C.3
D.0
[单选题]若x为int型变量,则以下函数fun的类型为( )。
fun(x)
{ printf(“%d\n”,x);}
A.返回值为void类型
B.无法确定返回值
C.返回值为int类型
D.无返回值
[单选题]有以下程序
struct stu
{ int num;
char name[10];
int age;
};
void fun(struct stu *p)
{ printf("%s\n",(*p).name); }
main()
{
struct stu students[3]={{9801,"Zhang",20},
{9802,"Wang",19},
{9803,"Zhao",18} };
fun(students+2);
}
输出结果是()。
A.Zhang
B.Zhao
C.Wang
D.18
[单选题]设有以下说明语句
typedef struct
{ int n;
char ch[8];
} PER;
则下面叙述中正确的是( )。
A.PER 是结构体变量名
B.PER是结构体类型名
C.typedef struct 是结构体类型
D.struct 是结构体类型名
[单选题]若有以下定义:
Char a; int b; float c; double d;
则表达式a*b+c-d值的类型为( )。
A.float
B.int
C.char
D.double
[单选题]以下程序的主函数中调用了在其前面定义的fun函数
#include
main()
{double a[15],k;
k=fun(a);
}
则以下选项中错误的fun函数首部是()。
A.double fun(double a[15])
B.double fun(double *a)
C.double fun(double a[])
D. double fun(double a)
[单选题]有以下程序段
char name[20];
int num;
scanf("name=%s num=%d",name;&num);
当执行上述程序段,并从键盘输入:name=Lili num=1001<回车>后,name的值为( )。
A.Lili
B.name=Lili
C.Lili num=
D.name=Lili num=1001
[单选题]8、 有以下程序
struct STU{
char name[10];
int num;
};
void f1(struct STU c)
{ struct STU b={"LiSiGuo",2042};
c=b;}
void f2(struct STU *c)
{ struct STU b={"SunDan",2044};
*c=b;
}
main( )
{ struct STU a={"YangSan",2041},b={"WangYin",2043};
f1(a);f2(&b);
printf("%d %d\n",a.num,b.num);}
执行后的输出结果是 ()。
A.2041 2044
B.2041 2043
C.2042 2044
D.2042 2043
[单选题]有以下程序
main()
{union
{char ch[2];
int d;
}s;
s.d=0x4321;
printf("%x,%x\n",s.ch[0],s.ch[1]);
}
在16位编译系统上,程序执行后的输出结果是()。
A.21,43
B.43,21
C.43,00
D.21,00