0

As someone who has used C in the past and knows it fairly well, what is a good guide to the C++ Standard Library? I feel like I am aware of the new language features of C++ in comparison to C well enough, but as I understand it C++ is almost defined by the standard library (containers and the like).

I am not interested as much in template metaprogramming.

Online resource preferred.

Emphasis on container types.

What is a guide to using std:: objects?

Aristides
  • 3,805
  • 7
  • 34
  • 41

3 Answers3

1

I realize that it isn't online and I may be biased but you may still find Nicolai Josuttis's "The C++ Standard Library" (Addison-Wesley) useful. It goes over all of the standard C++ library.

Dietmar Kühl
  • 150,225
  • 13
  • 225
  • 380
0

I've used this as a C++ reference all the way through College, and never really needed much more than this. http://www.cplusplus.com/reference/stl/?kw=stl I've primarily used vectors and maps. A multimap is basically a map, but it will allow you to have multiple entries under the same key which definitely comes in handy. It stores a vector of the specified type instead of a single instance. Also, it's good practice to store pointers to user defined objects instead of storing the objects themselves. This will prevent memory fragmentation. The reason for this is that a vector is just a managed array. Once that array is filled up, the whole vector gets copied to another malloc space twice that size. This can be a costly operation at run-time. Also if you're looking for more flexibility with the new operator, or you want to create your own memory pooling, check out http://www.cplusplus.com/reference/new/operator%20new/

aj.toulan
  • 1,341
  • 1
  • 16
  • 25
  • 4
    http://en.cppreference.com/w is a side with a slightly cleaner and more beginner-friendly interface but thanks! – Aristides Dec 11 '13 at 18:11
  • No problem. I apologize for the overly complicated reference. I assumed it would be suitable considering this is what I used when I was first learning procedural and then OO programming. – aj.toulan Dec 18 '13 at 19:10
  • Yeah, it's great, but I was looking for something a bit more focused on STL as I am familiar with procedural and OO styles already. Anyway, both are great, thanks! – Aristides Dec 18 '13 at 20:35
  • I didn't say you weren't familiar with procedural and OO styles. I was saying it was simple enough for a beginner to understand. It also tells you everything you need to know about stl, short of you actually digging through the sourcecode. Your response was confusing because you marked this as the answer. Please unmark my post as the answer in this case. – aj.toulan Dec 19 '13 at 18:08
  • I marked it as the answer because it was what I was looking for. I also wrote the initial comment with the other website for future inquirers. That is all. – Aristides Dec 19 '13 at 20:54
  • I must have been confused by your comment. Thanks – aj.toulan Dec 20 '13 at 14:38
0

I think the best way to learn frameworks is use them and find out the answers to the questions that will arise (thankfully we have Google).

If you want anything other than that I'd assume you want to be very thorough and skilled then I only have one suggestion to that, and that's a book.
(Personally I don't "believe" in any other kind of learning.)

In which case I suggest Dietmar Kühl's answer as I intended to recommend the same book. I have not read it but it's top on Amazon so should be good enough.

Best of luck.

Community
  • 1
  • 1
MasterMastic
  • 20,711
  • 12
  • 68
  • 90