> Thanks, for some reason one of the other programs I was working on had
> the std namespace messed up so I could use vectors without
> std::vector, no clue why... just worked.
>
> Got the vectors working in this program now! Thanks =)
All standard libbrary components(including anything referred to as stl) are
in namespace std. It is often best to explicitly qualify these. In some
cases you can bring the contents of any or all items from a namespace into
the current scope. This should be done with full knowledge of the
implications. A basic rule is to never do this in any file that can be
#included. A better solution often is to use typedefs.
For example in a function definition in a cpp file:
#include <vector>
#include <map>
#include <list>
typedef std::vector<int> tInts;
void somefnc()
{
tInts lInts(10,-1);
...
}
void someotherfnc()
{
using namespace std:
tInts lInts(10,-1);
list<int> lList;
copy( lInts.begin(), lInts.end(), back_inserter(lList) );
}
Jeff Flinn