B08电信C++上机.docVIP

  • 10
  • 0
  • 约4.32千字
  • 约 9页
  • 2016-06-25 发布于江西
  • 举报
B08电信C上机

课程:面向对象程序设计 学号: 200811513338 姓名: 韦忠权 上机练习题: (从C→C++部分)给出给出以下程序的执行结果: #include iostream.h void OutPut(char *str,int n) { if(str[++n]!=\0) OutPut(str,n); coutstr[n-1]; } void main( ) { char str[]=abcdefg; coutstrendl; int i=0; OutPut(str,i); coutendl; } (类和对象及其它特性部分)给出以下程序的执行结果: (1) #include “iostream.h” class CTest{ int a , b; public: CTest ( ){ a=b=0; } CTest( int aa , int bb=5) { a=aa; b=bb; cout”a=”a’ ‘”b=”b endl; } }; void main() { CTest x , y( 2,3) , z(4); } (2) #include iostream.h class CTest { private: int i; public: CTest() { i=25; cou

文档评论(0)

1亿VIP精品文档

相关文档