有以下程序 include<stdio.h> typedef struct { int num;double s; }REC; void funl(REC *x) { x->num=23;x->s=88.5; } void main() { REC a={16,90.0}; fun1(&A); printf("%d\n",a.num); } 程序运行后的输出结果是( )。
第1题:
设有如下定义,若要通过px引用rec中的x域,正确的语句()。 struct aa { int x; float y; } rec, *px; px=&rec;
A.px.x;
B.px->x;
C.*px->x;
D.*px.x;
第2题:
写出以下程序的执行结果。#include "stdio.h" void f13(int y,int *x) { y=y+*x; *x=*x+y; } int main() { int x=2,y=4; f13(y,&x); printf("%d,%dn",x,y); return 0; }
第3题:
请选出以下程序的输出结果( )。 #include <stdio.h> sub(int *s,int y) { static int t=3; y=s[t];t--; } main() { int a[]={1,2,3,4},i,x=0; for(i=0;i<4;i++) { sub(a,x);printf("%d",x); } printf("\n"); }
A.1234
B.4321
C.0
D.4444
第4题:
请选出以下程序的输出结果_______。 #include<stdio.h> sub(int*s,inty) { static int t=3, y=s[t];t-; } main() { int a[]={1,2,3,4},i,x=0; for(i=0;i<4;i++){ sub(a,x);printf("%d",x);} printf("\n"); }
A.1234
B.4321
C.0
D.4444
第5题:
下面程序的运行结果是( )。
include<stdio.h>
main()
{int a=25;
fun(&A);
}
fun(int *x)
{ printf("%d\n",++*x);
}
第6题:
下面程序运行时输出结果为【 】。
include<iostream.h>
include<malloc.h>
class Rect
{
public:
Rect(int1,int w)(length=1;width=w;)
void Print(){cout<<"Area:"<<length *width<<endl;)
void *operator new(size-t size){return malloc(size);}
void operator delete(void *p){free(p)
private:
int length,width;
};
void main()
{
Rect*p;
p=new Rect(5,4);
p->Print();
delete p;
}
第7题:
下列程序的输出结果是( )。 #include<stdio.h> void p(int *x) { printf("%d",++*x); } void main() { int y=3; p(&y); }
A.3
B.4
C.2
D.5
第8题:
有以下程序
include<stdio.h>
typedef struct
{int num;double s;}REC;
void funl(REC x){x.nllm=23;x.s=88.5;}
main( )
{REC a={16,90.0);
funl(A);
prinff(“%d\n”,a.num);
}
程序运行后的输出结果是【 】。
第9题:
有以下程序
#include <stdio.h>
typedef struct
{ int num;double s ; }REC;
void fun1( REC x ){x.num=23; x.s=88.5;}
main()
{ REC a={16,90.0 };
fun1(a);
printf("%d\n",a.num);
}
程序运行后的输出结果是 【 1 4 】 。