April 2017
Beginner to intermediate
394 pages
9h 16m
English
Now that we have seen a little about virtual constructors and the Prototype pattern, let's look at exactly what problem we are trying to solve.
To understand the problem of construction, we first need to understand the difference between a class and an object of that class. Classes are what the programmer creates. They are the code template or recipe that the program uses to create objects. In C++, we cannot create classes at runtime. We don't have a way to introduce new code while the program is running.
This is because C++ is a statically typed language. This means that the language tries to prevent operations if they can't be performed on that type at compile time. For example, we can't divide a float by a ...
Read now
Unlock full access