单项选择题
若有如下程序:
#include <iostream>
using namespace std;
int main()
char *p="abcdefgh",*r;
long *q;
q=(long *)p;
q++;
r=(char *)q;
cout<<r<<end1;
return 0;
上述程序的输出结果是( )。
A.abcdefgh
B.0
C.abcd
D.efgh
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序: #include <iostream> using namespace std; int main() int intone; int &rInt=intone; intone=5; rInt=7; cout<<intOne<< , <<rInt<<end1; return 0; 上述程序执行后的输出结果是( )。
A.5,7
B.7,5
C.5,5
D.7,7
点击查看答案&解析
单项选择题
下面是“二维向量” vector2D 的定义,其中作为成员函数重载的运算符“+”的功能是将两向量的分量x和y对应相加,然后返回作为相加结果的新对象。那么应该在横线上填入的语句是( )。 class vector2D private: double x; x分量 double y; y分量 public: vector2D(double x0=0,double y0=0) :x(x0),y(y0) void show(cout<<’ (’<<’, ’<<y<<’) ’; _________________________; ; vector2D :: operator + (vector2D
A.
B.vector2D operator + (vector2D &b)C) void operator + (vector2D)D) int operator + (vector
点击查看答案&解析
相关试题
下面程序的预设功能是:统计文件abc.txt中...
有如下程序: #include <iostream> u...
C++语言中,派生类继承了基类的全部数据...
C++中,设置虚基类的目的是 【10】 。
有以下程序: #include <iostream> u...