C++练习题(面向对象).pdfVIP

  • 12
  • 0
  • 约2.51千字
  • 约 8页
  • 2023-01-13 发布于上海
  • 举报
C++练习题 一、选择题 1、下列对函数的缺省参数的定义和描述及对函数的调用中正确的为 。 A.void showmessage(char *text=”hello”,int length,int color=0); B.int palette=1; int getcolor(int pal); void showmessage(char *text,int length=-1,int color=getcolor(palette)); C.在设置了函数的缺省参数后,调用函数的对应实参就必须省略。 D.showmessage(“how are you!”, ,8); 2、下面对引用的定义及使用中正确的是 。 A.int Z; B.int m=10; float t=m; C.void f(int a) { a++; couta; } void main() {f(3);} D.int d=2; int f() { d++; return d; } void main() { f();} 3、已知 const int a=1; int b=2; int *const cpint=b; const int *pcint=a; const int c=1; int d=2

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档