根据下面的程序,可以在主程序中使用的合法语句是( )。 #include <iostream> using namespace std; class Person{ int age; voidtest(){} public: Person(intage){this->age=age;} void ShowAge(){cout<<"the Person's age is",<<age;} }; void main(){ Person wang(23); }
A.wang.age=45
B.wang.wang(45)
C.wang.ShowAge()
D.wang.test()
[单选题]根据下面的程序,可以在主程序中使用的合法语句是( )。 include using namesp根据下面的程序,可以在主程序中使用的合法语句是( )。 #include <iostream> using namespace std; class Person{ int age; public: void SetAge(int x){age=x;} void ShowAge(){cout<<"the Person's age is" <<age;} }; class Student:pri
[试题]在下面的程序的横线处填上适当的语句,使该程序的输出为12。 include using namespace在下面的程序的横线处填上适当的语句,使该程序的输出为12。include<iostream.h>using namespace std;class Base{public:int a,b;B.ase(int i){a=i;}};class Derived:public Base{int a;public:D.erived(int x):Base(x),b(x+1){};void show(){
[单选题]下面的程序中,错误的语句是( )。 ①inClude②void main ③{ ④ int *p=new int[1]; ⑧P=9; ⑥cout<<.*P<<endl; ⑦delete[]p; ⑧}A.④B.⑤C.⑥D.⑦
[试题]在下面程序的横线处填上适当的语句,使该程序的输出为12。 include using namespace st在下面程序的横线处填上适当的语句,使该程序的输出为12。include <iostream>using namespace std;class Base{public:int a;B.ase(int i){a=i;}};class Derived: public Base{int a;public:D.erived(int x): Base(x),b(x+l){}void show(){
[单选题]下面程序错误的语句是 ① 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.⑦
[单选题]下面程序错误的语句是①#include②void main()③{④int*p=new int[1];⑤p=9;⑥cout <<*p<⑦delete[]p⑧}A.④B.⑤C.⑥D.⑦
[单选题]下面程序错误的语句是①include ②void main()③{④int * p=new int[1]⑤p=9⑥cout<<* p<下面程序错误的语句是①#include<iostream.h>②void main()③{④ int * p=new int[1]⑤ p=9⑥ cout<<* p<<end1;⑦ delete []p;⑧}A.④B.⑤C.⑥D.⑦
[单选题]在FoxBase程序中使用Public语句定义的是()变量。A .全程B .局部C .隐含D .私有
[判断题] 在使用子程序时,可以从主程序调用子程序,子程序也可以调用子程序,称为子程序嵌套。A . 正确B . 错误
[单选题]下面程序错误的语句是①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.⑦