若有以下定义: double d[10]; double *p1=d; double *p2=d[3]; 已知一个double型数据占8个字节,则p2-p1值为():A.8B.16C.24D.3

若有以下定义: double d[10]; double *p1=d; double *p2=&d[3]; 已知一个double型数据占8个字节,则p2-p1值为():

A.8

B.16

C.24

D.3


参考答案和解析
3

相关考题:

若有以下函数首部int fun(double x[10], int *n)则下面针对此函数的函数声明语句中正确的是A)int fun(double x, int *n);B)int fun(double , int );C)int fun(double *x, int n);D)int fun(double *, int *);

假定k是一个double类型的变量,则定义变量p的正确语句为()。 a. double p=b. int *p=c. double d. char *p="Thank you!";

以下选项中正确的定义语句是A)double a;b;B)double a=b=7;C)double a=7,b=7;D)double,a,b;

若有以下定义:char a;int b;float c; double d;则表达式a*b+d-c值的类型为【12】 。

若程序中定义了以下函数:double myadd(double a,double b){ return(a+b);}并将其放在调用语句之后,则在调用之前应该对该函数进行说明,以下选项中错误的说明是( )。A.double myadd(double a, b)B.double myadd(double ,double )C.double myadd(double b,double a)D.double myadd(double x,double y)

已知:double A(double A){return++a;}和int A(int a){return ++a;)是一个函数模板的两个实例,则该函数模板定义为【 】。

若有下列说明和语句,已知int型数据占2个字节,则下列语句的输出结果是( )。stmct st{char a[15];intb;double c;};printf("%d",sizeof(structSt));A.15B.8C.25D.2

若有下列说明和语句,已知int型数据占2个字节,则下列语句的输出结果是( )。stmct st{ char a[15];int b;double c;};printf("%d",sizeof(struct st));A.15B.8C.25D.2

下面程序的输出结果是【】。include include class point{double x; double y; 下面程序的输出结果是【 】。include <iostream.h>include <math.h>class point{double x;double y;public:point(double a, double b){x=a;y=b;}friend double distance(point a, point b) ;};double distance(point a, point b){return sqrt ((a. x-b.x) * (a. x-b.x)+ (a. y-b. y) * (a. y-b. y) );}void main(){point p1(1,2);point p2(5,2);cout<<distance(p1,p2)<<end1;}

若主调函数为double型,被调函数定义中没有函数类型说明,而return语句中的表达式为double型,则被调函数返回值的类型是double型。() 此题为判断题(对,错)。

若有以下定义: char a: int b; float c; double d; 则表达式a*b+d c的值的类型为 ______。A.floatB.intC.charD.double

若有以下函数首部: int fun(double x[10],int *n) 则下面针对此函数的函数声明语句中正确的是( )。A.int fun(double x, int *n);B.int fun(double, int);C.int fun(double *x, int n);D.int fun(double*, int*);

若有以下定义char a;int b;float c;double d;则表达式a*b+d-c值的类型为

已知a,b均被定义为double型,则表达式:a=5/2的值为()。A.1B.3C.3.0D.2.5

若有以下定义: char a;int b; float c;double d; 则表达式a*b+b-c值的类型为( )。A. floatSX 若有以下定义: char a;int b; float c;double d; 则表达式a*b+b-c值的类型为( )。A. floatB.intC.charD.double

使用VC6打开考生文件夹下的工程test11_3。此工程包含一个test11_3.cpp,其中定义了类CPosition,但该类的定义都并不完整。请按要求完成下列操作,将类CPosition的定义补充完整。(1)在类定义外完成重载的两个构造函数CPosition()和CPosition(double dx,double dy),其中前者为不带参数的构造函数,使CPosition对象的默认值为x=0,y=0,后者为带参数的构造函数,把数据成员x和y分别初始化为参数dx和dy的值。请在注释“//**1**”之后添加适当的语句。(2)在类体中添加函数move(double ax,double ay)的定义,使得点的坐标x和y分别移动ax和ay个单位,请在注释“// **2**”之后添加适当的语句。(3)完成函数double distance (double bx,double by)的定义,该函数返回*this和点(bx,by)的距离,请在注释“//**3**”之后添加适当的语句。注意:除在指定的位置添加语句外,请不要改动程序中的其他语句。源程序文件test11_3.cpp清单如下:include<iostream.h>include<math.h>class CPosition{public:CPosition();CPosition(double dx,double dy);double getx();double gety();// ** 2 **double distance(double bx,double by);private:double x;double y;};// ** 1 **{x=0;y=0;}CPosition::CPosition(double dx,double dy){x=dx;y=dy;}double CPosition::getx(){return x;}double CPosition::gety(){return y;}double CPosition::distance(double bx,double by){// ** 3 **}void main(){double a,b;cout << "Input x, y position of a point:";cin >> a >> b;CPosition psA(a,b);cout << “Input x,y position of another point:";cin >> a >> b;cout << "The distance is " << psA.distance(a,b) <<endl;}

若有以下函数首部 int fun(double x[lO],int *n) 则下面针对此函数的函数声明语句中正确的是______。A.int fun(double x, int *n);B.int fun(double, int);C.int fun(double *x, int n);D.iht fun(double*,int*);

以下程序的主函数中调用了在其面前定义的fun函数 #includestdio.h . . . main( ) {double a[15],k; k=fun(a); . . .} 则以下选项中错误的fun函数首部是( )。 、A.double fun(double a[l5])B.double fun(double *a) 。C.double fun(double a[])D.double fun(double a)

若有以下定义:char a;int b;float c;double d;则表达式a*b+d-c值的类型为( )。A.A. float SXB 若有以下定义:char a;int b;float c;double d;则表达式a*b+d-c值的类型为( )。A.A. floatB.intC.charD.double

以下程序的主函数中调用了在其前面定义的fun函数#includestdio.hmain(){ 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)

若主函数中有以下定义和语句: main() { double a[3][4]; …… fun(a) ; } 则正确的fun函数的首部是( )A.void fun(double *s)B.fun(double *s[4])C.fun(double(*s)[3])D.void fun(double(*s)[4])

若有以下定义:char a; int b; float c; double d; 则表达式a*b+d-c值的类型为______。A.floatB.intC.charD.double

在C++语言中,在IBMPC机环境下,double型数据占()字节。

若有函数定义:double fun(int a[10]){...},则在对该函数进行原型声明时,错误的声明语句是()A、double fun(int[])B、double fun(intb[10])C、double fun(inta)D、double fun(int*a)

已知一个函数的定义如下:double fun(int x,double y){⋯⋯}则该函数正确的函数原型声明为()A、double fun(intx,doubley)B、fun(int x,doubley)C、double fun(int,double);D、fun(x,y);

若程序中定义了以下函数 double myadd(double a,double b) { return(a+b); } 并将其放在调用语句之后,则在调用之前应该对该函数进行说明,以下选项中错误的说明是()A、double myadd(double a,b);B、double myadd(double,double);C、double myadd(double b,double a);D、double myadd(double x,double y);

单选题若有以下函数首部int fun(double x[10],int*n)则下面针对此函数的函数声明语句中正确的是(  )。Aint fun(double*,int*);Bint fun(double,int);Cint fun(double *x,int n);Dint fun(double x,int*n);

单选题若程序中定义了以下函数 double myadd(double a,double b) { return(a+b); } 并将其放在调用语句之后,则在调用之前应该对该函数进行说明,以下选项中错误的说明是()Adouble myadd(double a,b);Bdouble myadd(double,double);Cdouble myadd(double b,double a);Ddouble myadd(double x,double y);