CPlusPlus
CPP – use factory mode to generate different subclasses
Here is a simple example about how to use factory mode to generate different subclasses in CPlusPlus project. Class: RulerFactory: The whole project is at the following part. fac.hpp main.cpp Build and run it.