首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #include <iostream> using namespace std; int main( ){ int*P; *P=9; cout<<"The value at P:"<<*P: retu
有如下程序: #include <iostream> using namespace std; int main( ){ int*P; *P=9; cout<<"The value at P:"<<*P: retu
admin
2010-12-16
13
问题
有如下程序: #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、运行时有可能出错
答案
D
解析
int*p;指针变量定义时没有被初始化,也没有指向具体的地址,所以在后面打印时报错。应当做如下初始化:
int*p=new int( );
转载请注明原文地址:https://kaotiyun.com/show/6QVp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有以下程序#inelude<stdio.h>#defineSUB(x,y)(x)*(y)main(){inta=3,b=4;printf("%d\n",SUB(a++,b++));}程序运行后的输出结果是()。
有以下程序:#includemain(){char’b,c;inti:b=‘a’:c=‘A’:for(i=0;i
以下选项中,不能对主函数中变量i和j的值进行交换的程序是()。
软件按功能可以分为:应用软件、系统软件和支撑软件(或工具软件)。下面属于应用软件的是()。
给定程序MODI1.C中函数fun的功能是:从低位开始取出长整型变量S中奇数位上的数,依次构成一个新数放在t中,高位仍在高位,低位仍在低位。例如,当s中的数为:7654321时,t中的数为:7531。请改正程序中的错误.使它能得出正确的结果。
以下关于C语言的叙述中正确的是()。
数据独立性是数据库技术的重要特点之一。所谓数据独立性是指()。
下面的for语句的循环次数为()。for(x=1,y=0;(y!=19)&&(x<6);x++);
在软件开发中,需求分析阶段产生的主要文档是()。
设循环队列为Q(1:m),其初始状态为front=rear=m。经过一系列入队与退队运算后,front=30,rear=10。现要在该循环队列中作顺序查找,最坏情况下需要比较的次数为
随机试题
第一审民事判决书中,准予离婚的事件,判决结果应当写明
19世纪70年代到90年代,________向________即________过渡,出现了列强争夺殖民地的狂潮。________,中国陷入“________”。列强瓜分中国的图谋在1894年________爆发后达到高潮。
髋关节脱位的最多见类型是
肩部约束带主要限制病人()。
特发性血小板减少性紫癜病人实验室检查可见
导游员必须在送站前48小时与散客旅游者确认送站时间和地点。()
根据以下情境材料,回答问题。2015年,全国报告发生因滥用毒品导致暴力攻击、自杀自残、毒驾肇事等极端案件事件336起,查获涉案吸毒人员349名,破获吸毒人员引发的刑事案件17,4万起,全国每年因吸毒造成的直接经济损失及禁毒相关投入超过万亿元。根据以下毒品
下列不属于我国国家主席职权的是()。
在VisualFoxPro中,假设先打开了sdb数据库文件,接着打开了sc数据库文件,先要指定当前数据库为SDB,应使用命令:______DATEABASETOSDB。
NarratorListentopartofalectureonNew-AgeTransport.Nowgetreadytoanswerthequestions.Youmayuseyournotestohelp
最新回复
(
0
)