网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

下面程序的执行结果是 #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.20

D.4


参考答案

更多 “ 下面程序的执行结果是 #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 ” 相关考题
考题 以下程序中,能够通过调用函数fun,使main函数中的指针变量p指向一个合法的整型单元的是A.main( ) { int *p; fun(p); ┆ } int fun(int *p) { int s; p=s;}B.main( ) { int *p; fun(p); ┆ } int fun(int **p) { int s; *p=s;}C.#include<stdlib.h> main( ) { int *p; fun(p); ┆ } int fun(int **p) { *p=(int*)malloc(2);}D.#include<stdlib.h> main( ) { int *p; fun(p); ┆ } int fun(int *p) { p=(int*)malloc(sizeof(int));}

考题 以下程序段中,能够通过调用函数fun,使main函数中的指针变量p指向一个合法的整型单元的是______。A.main() { int *p; fun(p); …… } int fun(int *p) {int s; p=s;}B.main() { int *p; fun(p); …… } int fun(int **p) {int s; *p=s;}C.# include<stdlib. h> main() {int *p; fun(p); …… } int fun(int **p) {*p=(int *)malloc(2);}D.# include<stdlib. h> main() { int *p; fun(p); …… } int fun(int *p) {p=(int *)malloc(sizeof(int));}

考题 有以下程序includevoid f(int *p,int *q);main(){ int m=1,n=2,*r=m;f(r, n 有以下程序 #include<stdio.h> void f(int *p,int *q); main() { int m=1,n=2,*r=m; f(r, n); printf("%d,%d",m,n); } void f(int*p,int*q) {p=p+1; *q=*q+1;) 程序运行后的输出结果是______。A.1,3B.2,3C.1,4D.1,2

考题 有以下程序includestdio.hint*f(int*p,int*q);main( ){int m=1,n=2,*r=m;r=f(r,stdio.hint*f(int*p,int*q);main( ){int m=1,n=2,*r=m;r=f(r,n);printf(”%d\n”,*r);}int-f(int*P,int*q)(return(*p*q)?p:q;)程序运行后的输出结果是______。

考题 以下程序的输出结果是include "stdio.h"int *f(int *x,int *y){ if(*x*y) return x; else return y;}main(){ int a=7,b=8, *p,*q,*r ; p=a; q=b; r= f(p,q); printf("%d,%d,%d\n",*p,*q,*r);}

考题 以下定义数组中错误的是下面程序的执行结果是 #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() {int*p,r; p=new in; *p=20; r=sizeof(*p); cout<<r<<endl delete p;}A.程序错误B.内存为20地址的大小C.20D.4

考题 下面程序的执行结果是( )。 #include"iostream.h" voidmain() {int*P,r; P=newint: *P=20: r=sizeof(*p); coutrendl; deleteP;}A.程序错误B.内存为20地址的大小C.20D.4

考题 下面程序的执行结果是 #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