"C ++ shortcut tutorial" reading note - Chapter 11 - class (sixth part)

xiaoxiao2021-03-18  187

// - "C shortcut tutorial" reading notes - Chapter 11 - Class (Part 6) // - Chapter 11 - Class // - 03/15/2006 Wed.//--computer LAB / / - Liwei

// - Program # 6 myclass # include using namespace std;

Class myclass {int A; public: myclass (int x); int GET_A ();

Myclass :: myclass (int x) {a = x;

INT myclass :: get_a () {return a;}

Int main () {myclass ob = 4; MyClass OC (444); myclass = myclass (4444); cout << ob.get_a () << "<< Oc.get_a () <<" << OD .get_a () << endl; return 0;}

转载请注明原文地址:https://www.9cbs.com/read-129883.html

New Post(0)