I have a long standing love for the class structure of C++. I have even written a couple of books on C++ class structures, so I have some experience with it. However, C++ doesn’t really lend itself to class structures right out of the box. Instead, you have to use a few tricks and tricks to get things done with class structures.
One of those tricks is to make sure you dont have any static members in your class, so that the compiler knows that you are not a member of the class. Another trick is to make sure you dont have any public/protected/private fields in your class. That way the compiler will allow you to set them to NULL. And of course, making sure you don’t have any non-static methods in your class.
In a previous c++ tutorial we were talking about inheritance, we used the same approach.
So you have two classes, one with a static member, and one with a non-static member.
Class is a noun for classes. So that means there are two of them. But then you have a couple of more classes. I would say that you are a class.
Of course, I wasnt talking about inheritance. I was talking about the way that we use classes in c++. So basically the way that we use classes in c++ is by inheriting one class from another. A class is a set of subclasses. So the classes we created in the first tutorial are now inherited from other classes. You may have read about the concept of “abstract classes” before. These are classes that have no members.
Abstract Classes can be used to create abstract entities. Abstract classes are also types that can be instantiated from other objects and can be used as containers with some common methods (like adding objects). But for now, they are the only type of class that we create in this first tutorial.
It’s like when we play a video game, we’re usually playing on a computer. But in real life we play on a real, physical joystick. We’re always making decisions based on what we see on the screen, or what the other person is doing, as well as the reactions we get from those around us. In c++, we’re always just doing things by having to remember what we’ve done and what our class needs to do.