View Single Post
  #8 (permalink)  
Old 07-26-2007, 08:19 AM
Bench Bench is offline
Full Programmer
Join Date: Jul 2007
Location: UK
Posts: 113
iTrader: (0)
Bench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished road
Quote:
Originally Posted by HelloWorld View Post
do you personally memorized most of the common libraries that can be included in C++ ???

I don't even know what do:

Code:
#include <iostream>
#include <cstdlib>
#include <ctime>
contains? I want to see what are methods that I can use by including those libraries in my program... somehow...
I think, if you exclude the 'C' libraries (those which begin with the letter 'c'), then the C++ standard library is fairly limited. (And thus, once you get to grips with it, easy to remember). The reason being that the library can be mostly divided up into 3 or 4 seperate 'parts'.

First of all, you have the 'stream' family, which is all about I/O and string manipulation

<istream> - generic input stream
<ostream> - generic output stream
<fstream> - file i/o
<sstream> - string manipulation
<iostream> - standard i/o (cin, cout, etc)


Then you have the various STL containers. These all store multiple items of data together. (Each of them does it slightly differently, but in each case, they're almost always better than 'C' style arrays)

These are unsorted STL containers -
<deque> - double-ended queue
<queue> - ordinary queue (First In/First Out)
<vector> - a one-dimensional matrix (a "C++ Array" )
<list> - a linked list.
<stack> - stack (Last In/First Out)

More STL containers, all based on a Binary Tree, thus are automatically sorted -
<set> - Holds sets of data. each item must be unique
<multiset> - As above, but allows duplicates
<map> - allows a dictionary of data to be created, sorted based on a 'key'
<multimap> - same as a map, but allows duplicate keys

I would also count this one as a special-case container, because it behaves similarly to STL containers, except that its contents are characters

<string> - Far, far better than horrible C-style char arrays;

One great thing about STL containers, is that once you understand how to use one container, you generally understand how to use them all. (Most often, you will probably ignore all the STL containers except for vector)


That's pretty much all you need.. there are a few other C++ libraries which don't fit comfortably under any general heading (Iterators, Algorithms, etc). Most of which are geared towards manipulating STL containers. You don't need to worry much about them yet.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!

Last edited by Bench : 07-26-2007 at 08:23 AM.
Reply With Quote
The Following User Says Thank You to Bench For This Useful Post:
HelloWorld (07-26-2007)