编译语句int aInt=66666不会出现编译错误。
第1题:
下面哪条语句在编译时不会出现错误或警告( )。
A.floatf=1.3;
B.byte b=257;
C.boolean b=null;
D.int i=10;
第2题:
此题为判断题(对,错)。
第3题:
有以下定义语句,编译时会出现编译错误的是
A)char a='a';
B)char a='\n';
C)char a='aa';
D)char a='\x2d';
第4题:
有如下程序:
#include<iostream>
#include<cmath>
using 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.程序编译时语句③出错
第5题:
A.float f= 3.14;
B.char c=”c”;
C.Boolean b=null;
D.int i= 10.0;
第6题:
有如下程序段int i=0,j=1;int &r=i; //①r=j; //②int*p=&i; //③*p=&r; //④其中会产生编译错误的语句是
A.④
B.③
C.②
D.①
第7题:
main函数中发生编译错误的语句是______。
include<iostream.h>
class A
{
public:
int a;
const int b;
A( ):a(10),b(20){}
void fun( )const
{
cout<<"a="<<a<<"\tb="<<b<<endl;
}
};
void main( )
{
A obj1;
const A*ptr=new A;
ptr=&obj1;
ptr->a=100;
ptr->fun( );
}
第8题:
( 20 )有如下程序段
int i =0, j=1;
int & r=i ; // ①
r =j; // ②
int*p= & i ; // ③
*p= & r ; // ④
基中会产生编译错误的语句是
A ) ④
B ) ③
C ) ②
D ) ①
第9题:
对于已经被定义过可能抛出异常的语句,在编译时()。
A.必须使用try/catch语句处理异常
B.如果程序错误,则必须使用try/catch语句处理异常
C.不使用try/catch语句会出现编译错误
D.不使用try/catch语句不会出现编译错误
第10题:
下面哪条语句在编译时不会出现错误或警告( )。
A.float f=1.3;
B.byte b=257;
C.boolean b=null;
D.int i=10;