0
C++ Classes (help)
Hello, I am learning C++ but I couldn't understand classes. I read an article about classes last day. It said: "For example, you want to make a modeling program (e.g. 3ds max). You need 2 variable for coordinates. You need a mouse cursor (I guess these are objects). You need 2 function to make the mouse cursor appear and to disappear the mouse cursor." What I don't understand is if I write "Hey mouse cursor, show yourself" in a function and when I call it, will mouse cursor appear? So how can I do that?
3 Réponses
+ 1
A class is used to give all objects the same functions or behaviors, but different values, possesions, etc.
For example, a class called Human, every humans walk, talk, do anything... But an Human (object) could have a different name or age than other Human.
class Human{
private:
//personal
char passwords;
protected:
//to he and his children
char personalDocuments;
public:
//to everybody
char hobby;
char name;
int age;
void sayHi();
void walk();
void doAnything();
}Jhon,Henry,Mary;
0
look in any programming language the class is group of methods
the methods is group of operations of programing