[C++] 具有public访问权限的成员的应用 →→→→→进入此内容的聊天室

来自 , 2021-01-25, 写在 C++, 查看 112 次.
URL http://www.code666.cn/view/11108a3d
  1. #include "stdafx.h"
  2. #include"iostream"
  3. using namespace std;
  4. class Limit    
  5. {      
  6. public:
  7.         char name[30];
  8.         void accept()
  9.         {
  10.                 cout << "\n  Enter Your Name,please!";
  11.                 cin >> name;
  12.                 cout << "\n Your name is:" << name << endl;
  13.         }
  14. };
  15. int main()
  16. {
  17.         Limit c;
  18.         c.accept();
  19.         cout << c.name << endl;
  20. }
  21. //2014年4月22日19:36:38
  22. //20行

回复 "具有public访问权限的成员的应用"

这儿你可以回复上面这条便签

captcha