I have just finished reading a C++ book. This is my first library, probably not very useful, but it was a learning experience. I would appreciate some feedback on the code. Like if ive misunderstodd or used something wrong.
You can use git to get the files from github, and then make the binary with with makefile, or just browse the source on github:
For things like this, it would be easier and more optimized to use an enum type.
Also, for realistic criticism, the library isn't flexible enough for shared use. Although you may not care ;P.
1) Your class CardException - is there a reason you're not deriving it from std::exception?
2) CardException doesn't use anything in <iostream>, so you might consider removing the include.
3) You might consider passing const string references in your CardException class to avoid making unnecessary copies of strings.
4) CardDeck and Card have virtual destructors - was this intentional?
5) A few other places, you're passing vectors by value, where it could be by reference.
6) computerquip already hit the enums
All in all, it's not bad. What I've listed are pretty much all minor points.
If I'm not mistaken, a LOT of tutorials and books that I've read actually make it a rule of thumb to make all destructors virtual.
I don't think that is very sound advice. Remember that as soon as you add a virtual method or virtual destructor to a class, the class automatically gets a vtable pointer that it wouldn't otherwise get. This memory consumption is a penalty to any programmer who never intends to derive from the class, and was largely the thinking behind not making any STL containers have virtual destructors.
[In general, the C++ committee's overriding mantra is to not make programmers pay for things they don't use.]