AI智能整理导入 AI智能整理导入
×
首页 题库中心 c语言程序设计题库 题目详情
CA85E835B92000012B50FB49F93816B5
c语言程序设计题库
1,073
单选题

下列代码执行后的结果是( )
int Fun(int nA, int * nB)
{
int nC = 0;
nA += 10;
*nB += 10;
return *nB + nA;
}
void main(void)
{
int nA = 1;
int nB = 2;
int nC = 3;
nC = Fun(nA, &nB) ;
printf("%d, %d, %d", nA, nB, nC) ;
}

A
1, 12, 23
B
1, 2, 23
C
编译出错
D
运行出错

答案解析

正确答案:A

解析:

指针
c语言程序设计题库

扫码进入小程序
随时随地练习

相关题目

单选题

以下scanf 函数调用语句中对结构体变量成员的不正确引用是( )。
struct pupil
{ char name[20];
int age;
int sex;
} pup[5],*p;
p=pup;

单选题

有以下定义和语句, 则值为6 的表达式是( )。
struct s
{ int i1;
struct s *i2;
};
static struct s a[3]={5,&a[1],7,&a[2],9,'\0'},*ptr;
ptr=&a[0];

单选题

设有如下定义:
struct sk
{int n;
float x;
} data,*p;
若要使p指向data中的n域, 正确的赋值语句是( )。

单选题

若有以下说明和语句:
struct student
{ int age;
int num;
} std,*p;
p=&std;
则以下对结构体变量std 中成员age 的引用方式不正确的是( )。

单选题

若有以下程序段:
struct student
{
int num ;
int age ;
}
struct student stu[3]={{101,20},{102,19},{103,20}};
main( )
{ struct student *p;
p=stu;

}
则以下引用形式不合法的是( )。

单选题

若有以下说明和语句, 则在scanf 函数调用语句中对结构体变量成员的不正确引用方式是( )。
struct pupil
{ char name[20];
int age;
int sex;
}pup[5],*p;
p = pup;

单选题

以下程序的输出结果是( )。
struct stu
{ int x;
int *y;
} *p;
int dt[ 4 ]={ 10 , 20 , 30 , 40 } ;
struct stu a[ 4 ]={ 50 , &dt [ 0] , 60 , &dt [1] ,70 , &dt [ 2] , 80 , &dt [ 3 ]};
main ( )
{ p = a ;
printf (“%d”,++p->x ) ;
printf (“%d”,(++p)->x) ;
printf (“%d\n”,++(*p->y)) ;
}

单选题

若有以下说明和语句, 则下面引用形式中不正确的是( )。
struct student
{ int age ;
int num;
} ;
struct student stu [ 3 ] = {{1001 , 20 } , { 1002 , 19 } , { 1003 , 21 } } ;
struct student *p ;
p = stu ;

单选题

以下对结构体变量stul 中成员age 的非法引用是( )。
struct student
{ int age ;
int num;
}stul,*p;
P=&stul;

单选题

设有以下说明和定义语句, 则下面表达式中值为3 的是( )。
struct s
{ int i1 ;
struct s *12 ;
} ;
static struct s a [3]={1,&a[1],2,&a[2],3,&a[0]},*ptr;
ptr=&a[1];

关闭
专为自学备考人员打造
试题通
自助导入本地题库
试题通
多种刷题考试模式
试题通
本地离线答题搜题
试题通
扫码考试方便快捷
试题通
海量试题每日更新
试题通
欢迎登录试题通
可以使用以下方式扫码登陆
试题通
使用APP登录
试题通
使用微信登录
xiaochengxu
联系电话:
400-660-3606
xiaochengxu