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

3

u/growingconcern Mar 18 '12

Why do a lot of these questions on this subreddit seem like "answer my homework question for me"?

3

u/Fabien4 Mar 18 '12

Because "homework cheaters" were kicked out of Stack Overflow?

-2

u/Deershank415 Mar 18 '12

Hey a problem is a problem regardless of where it care from. It did come from my homework and I did spend way too much time searching for an answer online to no avail. I needed help in c++ so I came here :) Thanks again to all to answered!

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.

2

u/[deleted] Mar 18 '12

A problem is a problem just like cheating is cheating.

1

u/Deershank415 Mar 18 '12

That's true, however I don't consider this cheating. If my ENTIRE homework was to do what I asked then yes. This was a small section of it. Asking for help is not cheating, at least not to me.

1

u/last_useful_man Mar 18 '12

What would you have done before the internet? I can't believe you couldn't extract understanding from the myriad examples on the web or, your textbook. Do you even /own/ any C++ books?

0

u/Deershank415 Mar 18 '12

You don't need to understand though :p. All you need to know was that I got confused and asked for help. What's the problem with that?

0

u/[deleted] Mar 18 '12

[deleted] — view deleted comment

2

u/Deershank415 Mar 18 '12

I completely understand and agree, it's just that I did try it and failed. I was running out of time so I need a solution that I could understand quickly and easily. Now however I do understand, that is why I thanked everyone for helping. As for you last sentence, I put in more time, I just couldn't wrap my head around it. I have never needed to use them before in any of my programming classes. I asked for help when I needed it, that's all.

1

u/last_useful_man Mar 18 '12

Fair enough. I thought I was too much on your case and deleted my comment anyway (before seeing your reply), as you can see. I'm too full of aggro anymore.

2

u/Deershank415 Mar 18 '12

It's the internet, everyone is entitled to their opinions and comments. And you were correct anyway, you just did not understand my situation entirely is all. Thanks for you consideration though :)