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

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

有如下程序: #include<iostream) using namespace std; int main() { int*p; *p=9; cout<<“The value at p:”<<*p; return 0; } 编译运行程序将出现的情况是( )。

A.编译时出现语法错误,不能生成可执行文件

B.运行时一定输出:The value at p:9

C.运行时一定输出:The value at p:*9

D.运行时有可能出错


参考答案

更多 “ 有如下程序: #include<iostream) using namespace std; int main() { int*p; *p=9; cout<<“The value at p:”<<*p; return 0; } 编译运行程序将出现的情况是( )。A.编译时出现语法错误,不能生成可执行文件B.运行时一定输出:The value at p:9C.运行时一定输出:The value at p:*9D.运行时有可能出错 ” 相关考题
考题 下面程序错误的语句是①include ②void main( 0③{④int * p = new int[1] ;⑤p =9;⑥co 下面程序错误的语句是 ①#include < iostream.h> ②void main( 0 ③{ ④ int * p = new int[1] ; ⑤ p =9; ⑥ cout <<*p <<end1; ⑦ delete [ ] p; ⑧ }A.④B.⑤C.⑥D.⑦

考题 下面程序错误的语句是 ① include ② void main( ) ③ { ④ int * p=new int[1] ; ⑤ p 下面程序错误的语句是① #include<iostream.h>② void main( )③ {④ int * p=new int[1] ;⑤ p=9;⑥ cout < < * p < <endl;⑦ delete[ ] p;⑧ }A.④B.⑤C.⑥D.⑦

考题 以下程序中,能够通过调用函数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 main() {int *p;p=new int;*p=200;cout 以下程序的输出结果是【 】。include<iostream. h>void main() {int *p;p=new int;*p=200;cout<<*p;delete p;}

考题 以下程序段中,能够通过调用函数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));}

考题 如下程序的执行结果是 include void main( ) { static int a[ ]={ 1,7,3,9,5,11 如下程序的执行结果是 #include<iostream.h> void main( ) { static int a[ ]={ 1,7,3,9,5,11 }; int * p=a; * (p+3)+=4; cout < < * p < <"," < < * (p+3);}A.1,13B.1,16C.3,13D.1,14

考题 有如下程序:include using namespace std;int main(){ int *p; *p = 9;cout 有如下程序: #include <iostream> using namespace std; int main() { int *p; *p = 9; cout << "The value at p: " << *p; return 0; } 编译运行程序将出现的情况是( )。A.编译时出现语法错误,不能生成可执行文件B.运行时一定输出:The value at p:9C.运行时一定输出:The value at p:*9D.运行时有可能出错

考题 有如下程序:includeusing namespace std;int main(){int *p;*p=9;cout 有如下程序: #include<iostream> using namespace std; int main() { int *p; *p=9; cout<<"The value at p:"<<*p; return 0; } 编译运行程序将出现的情况是( )A.编译时出现语法错误,不能生成可执行文件B.运行时一定输出:The value at p:9C.运行时一定输出:The value at p:*9D.运行时有可能出错

考题 以下程序段中,能够通过调用函数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));}

考题 下面程序错误的语句是①include ②void main()③{④int * p=new int[1]⑤p=9⑥cout 下面程序错误的语句是①#include<iostream.h>②void main()③{④ int * p=new int[1]⑤ p=9⑥ cout<<* p<<end1;⑦ delete []p;⑧}A.④B.⑤C.⑥D.⑦