It has been a few years since I have had to do this, but I need to declare a method in my base class, but produce no code for it. Then when this library is used by my second project I will derive a class from this base class and put the code into it there. How is this possible? I used to know how but do not remember how now.
The library is a static library designed for linking with both 32bit and 64bit Windows applications to handle a lot of the tedious stuff with Windows programming. The method in question handles specific command inputs. However, since each program that uses this library will have different uses for these commands, I want to leave it up to the user to code their own handling, but require it to be coded in the derived class.
The = 0 part is the key. This is called a Pure Virtual member function, and it makes the entire class Pure Virtual (aka Abstract, uninstantiable). Fun fact, though, you can still provide a definition for this function for deriving classes to call for some kind of default behavior - being pure virtual just means the deriving class must implement it if it doesn't want to be abstract.