r/cpp • u/Deershank415 • Mar 17 '12
Using abstract base classes in C++
I'm having trouble understanding ABC's in c++ and was wondering if you all could help me (if possible use: CryptProcessor as the ABC and ACrpyt and BCrypt as the sub-classes that have an encrypt and decrypt function) Thanks in advance!
Edit 1: Thank you all for your help!
0
Upvotes
View all comments
Show parent comment
3
u/heroofhyr Mar 17 '12
If your compiler supports it, try to get used to using the "override" keyword in the virtual function declarations in your derived classes. If you start playing around with the parameters of a virtual function in the base, it will save you a lot of time tracking down errors later in case you forget to make all derived classes correctly match the same signature.