编译语句int aInt=66666不会出现编译错误。
对于已经被定义过可能抛出异常的语句,在编译时()。A.必须使用try/catch语句处理异常B.如果程序错误,则必须使用try/catch语句处理异常C.不使用try/catch语句会出现编译错误D.不使用try/catch语句不会出现编译错误
点击查看答案
有如下程序:#include#includeusing std::cout;class Point{public:friend double distance(const Point &p); //P距原点的距离Point(int xx=0,int yy=0):x(xx),Y(YY){}//①private:int x,y;};double distance(const Point &p){ //②return sqrt(P.x*P.x+P.y*P.y);}int main(){Point p1(3,4);cout<<distance(p1);return 0; //③}下列叙述中正确的是A.程序编译正确B.程序编译时语句①出错C.程序编译时语句②出错D.程序编译时语句③出错
下面哪条语句在编译时不会出现错误或警告( )。A.float f=1.3;B.byte b=257;C.boolean b=null;D.int i=10;
下列程序编译时发现pb->f(10);语句出现错误,其原因是______。 include class Base {下列程序编译时发现pb->f(10);语句出现错误,其原因是______。include<iostream.h>class Base{public:void f(int x){cout<<"Base:"<<x<<endl;)};class Derived:public Base{public:void f(char*str){cout<<"Derived:"<<str<<endl;}};void main(void){Derived*pd=new Derived;Pd->f(10);}
有以下定义语句,编译时会出现编译错误的是( )。A.AB.BC.CD.D
有以下定义语句,编译时会出现编译错误的是( )。 A)B)A.B.
有如下程序: Class Base{ publiC: int data; }; Class Derivedl:publiC Base{}; Class Derived2:proteCted Base{}; int main( ) { Derivedl dl; Derived2 d2; dl.data=0;//① d2.data=0;//② retum 0; } 下列关于程序编译结果的描述中,正确的是( )。A.①②皆无编译错误B.①有编译错误,②无编译错误C.①无编译错误,②有编译错误D.①②皆有编译错误