未分类题
类中包含了一个静态成员函数,则main函数中和P.f1(P);语句具有同样功能的语句为______。
include<iostream.h>
class M
{public:
M(int A){A=a;B+=a;}
static void f1(M m);
private:
int A;
static int B;};
void M::f1(M m)
{
cout<<“A=“<<m.A((end1;
cout<<“B=”<<m.B<<en
A.f1(P);语句具有同样功能的语句为______。
include<iostream.h>
B.A((end1;
C.B<<en
【参考答案】
M::f1(P);。
M::f1(P);。 解析: 由于f1是类M的静态成员函数,即说明类M的任何对象都共享一份......
(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)
点击查看答案
<上一题
目录
下一题>
热门
试题
问答题
SECTION B ENGLISH TO CHINESEDirections:Translate the following text into Chinese.The disturbance of the soul cannot be ended nor true joy created either by the possession of the greatest wealth or by honor and respect in the eyes of the mob or by anything else that is associated with causes of unlimited desires...We must not violate nature,but obey her;and we shall obey her if we fulfill the necessary desires and also the natural,if they bring no harm to us,but sternly reject the harmful...The man who follows nature and not vain opinions is independent in all things.For in reference to what is enough for nature every possession is riches,but in reference to unlimited desires even the greatest wealth is not riches but poverty.Insofar as you are in difficulties,it is because you forget nature;for you create for yourself unlimited fears and desires.It is better for you to be free of fear lying upon a pallet,than to have a golden couch and a rich table and be fall of trouble.
点击查看答案
未分类题
include<stdio.h> void main() { int i=11,j; j=i%3; switch(j) {case 1: case 2:printf('%d n',j);break; default:printf('%d n',i); } }
点击查看答案
相关试题
当使用魔棒工具选择图像时,在“容差”数值...
在拼合图层时,会将暂不显示的图层全部删除...
显示与隐藏参考线快捷键是Ctrl+H()
采用该战略有可能面临哪些障碍?如何解决?
From this passage we can learn tha...