"C ++ shortcut tutorial" reading notes - Chapter 11 - Class (Part 5)

xiaoxiao2021-03-18  225

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

// - Program # 5 queuq # include using namespace std;

Class Widget {Int i; int J; int K; public: widget (int A, int b, int c = 999); void put_widget ();

Widget :: widget (int A, int b, int C) {i = a; j = b; k = C;}

Void widget :: put_widget () {cout << i << "" << j << "<< k <<" / n ";}

INT main () {Widget X (10, 20, 555), Y (0, 0); x.put_widget (); y.PUT_WIDGET (); Return 0;}

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

New Post(0)