[单选题]

下面程序的执行结果是( )。

include"iostream.h"

voidmain()

{int*P,r;

P=newint:

*P=20:

r=sizeof(*p);

cout<<r<<endl;

deleteP;}

A.程序错误

B.内存为20地址的大小

C.20

D.4

参考答案与解析:

相关试题

下面程序的执行结果是#include"iostream.h"void main(

[单选题]下面程序的执行结果是 #include"iostream.h" void main() { int * p,r; p=new int; *p=20; r=sizeof(*p); cout<<r<<endl; delete p; }A.程序错误B.内存为20地址的大小C.20D.4

  • 查看答案
  • 下面程序的结果是#include"iostream.h"void main(){

    [单选题]下面程序的结果是 #include"iostream.h" void main() { char*str; Str="test!"; cout<<str[5]; }A.程序错误B.!C.'/0'D.为空字符

  • 查看答案
  • 下面程序的结果是()。#include"iostream.h"void main

    [单选题]下面程序的结果是( )。 #include"iostream.h" void main() { char *str; Str="test!"; cout<<str[5]; }A.程序错误B.!C.'/0'D.为空字符

  • 查看答案
  • 下面程序的结果是#include"iostream.h"void main()

    [单选题]下面程序的结果是 #include"iostream.h" void main() { char*str; str="test!"; cout<<str[5]; }A.程序错误B.!C.’/0’D.为空字符

  • 查看答案
  • 下面程序的运行结果是#include"iostream.h"#define su

    [单选题]下面程序的运行结果是 #include"iostream.h" #define sum(a,b)a*b void main() {int x; X=sum(1+2,3); cout<<x; }A.0B.9C.7D.5

  • 查看答案
  • 下面程序的结果为()。#include"iostream.h"void chan

    [单选题]下面程序的结果为( )。 #include"iostream.h" void change (int a,int b) { int temp; temp=a; a=b; b=temp: } void main() { int m,n; m=8; n=9; change(m,n): cout << m<<" "<< n << endl; }A.89B.98C.程序有错误D.99

  • 查看答案
  • 下面程序输出的结果为( )。include"iostream.h"classA{

    [单选题]下面程序输出的结果为( )。include"iostream.h"classA{public:A.(){cOUt<<"CLASSA"<<endl;}~A(){}};C.laSSB:publicA{public:B.(){cout<<"CLASSB"<<endl;}~B(){}};voidmain(){A*P;P=newB:B.*q:q=newB;}A.CLASSAB.CLASSACLASSBCLASSBCLASSBC.CLASSAD.C

  • 查看答案
  • 下面程序的结果为#include"iostream.h"void change(

    [单选题]下面程序的结果为 #include"iostream.h" void change(int a,int B) { int temp; temp=a; a=b; b=temp; } void main() { int m,n; m=8; n=9; change(m,n); cout<<m<<" "<<n<<endl; }A.8 9B.9 8C.程序有错误D.9 9

  • 查看答案
  • 下面程序输出的结果为 #include" iostream.h" class

    [单选题]下面程序输出的结果为 #include" iostream.h" class A { public: A( ) { cout < < "CLASS A" < < end1;} ~ A( ) { } }; class B:public A { public: B( ){ cout < < "CLASS B" < < end1;} ~ B( ) { } }; void main( ) { A * p; p=new B; B * q;A.CLASS A CLASS BB.CLASS A C

  • 查看答案
  • 下面程序的结果为()。#include"iostream.h"void chan

    [单选题]下面程序的结果为( )。 #include"iostream.h" void change(int a,int b) { int temp; temp=a; a=b b=temp; } void main() { int m,n; m=8; n=9; change(m,n); cout<<m<<" "<<n<<endl; }A.89B.98C.程序有错误D.99

  • 查看答案
  • 下面程序的执行结果是( )。include"iostream.h"voidmai