题目内容:
下面程序的输出结果是#includeiostream.h>
class example
{
int a;
public:
example(int b) {a=b++;}
void pnnt( ) {a=a+1;cout a " ";}
void print( ) const{cout a " ";}
};
void main( )
{
example x(3) ;
const example y(2) ;
x.print( ) ;
y.print( ) ;
} A.2 2
B.4 3
C.4 2
D.3 2
参考答案:
答案解析: