Reading a File Into a Ctor Then Using It in a Derived Class C++
Revision on Classes and Objects
Let us revise the basics of OOP with an example of modeling 2d points with integer coordinates (x, y) in a class called Betoken, every bit shown in the class diagram.
Header File: Betoken.h
1 2 three iv 5 6 7 8 9 10 11 12 13 xiv fifteen 16 17 eighteen xix | #ifndef POINT_H #define POINT_H class Indicate { private: int x, y; public: Betoken(int ten = 0, int y = 0); int getX() const; void setX(int 10); int getY() const; void setY(int y); void setXY(int x, int y); void print() const; };
|
0 Response to "Reading a File Into a Ctor Then Using It in a Derived Class C++"
Post a Comment