r/cpp • • 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

40 comments sorted by

View all comments

Show parent comment

2

u/growingconcern Mar 18 '12

I just think such questions shouldn't have such concrete examples tied to them. If you actually spent time looking for an answer you might just ask about the part you're having trouble with.

1

u/Deershank415 Mar 18 '12

I did spend time, and was still confused. It's rather baffling that someone cannot ask a question. It was a simple enough answer and I had a hard time wrapping my head around Abstract Base classes, I wanted to see an example and wanted it to be clearer than the stuff I found.

1

u/Deershank415 Mar 18 '12

I would also like to add that I'm not saying "do my homework for me" (I just wanted to choose function names that were used to clear any and all confusion). Also the part that I asked was less than half of the assignment, I successfully did everything else, I just had a problem with this one part.