Advertisement

vector template problem

Started by February 07, 2000 02:09 PM
4 comments, last by dirtydevil 24 years, 10 months ago
I want to use the C++ template vector, I have used on borland C++ Builder, but Visual C++ 5.0 doesn''t like it... My question is why? I just want to define a collection of ints, so I have the following code: /*========================*/ #include ... vector vi; /*========================*/ So VC++ says "vector missing decl-specifiers" Well, thanks any help
http://www.stas.net/rafael/icq: 11915640
The html just destroyed my example. Just assume [ as <
/*========================*/
#include [vector]
...
vector[int] vi;
/*========================*/
http://www.stas.net/rafael/icq: 11915640
Advertisement
Try including "vector.h" instead of "vector"

I''ve had similar problems with Microsoft''s STL
Or try doing std::vector. (or, using namespace std; ). This is because MS actually does this part of the standard correctly. (ie better than GNU).

-Brian

Edited by - osmanb on 2/8/00 12:39:44 PM
When I use VC++ 5.0, I have to include this line:

using namespace std;

before any STL code. I found this in the MS help section if you search for STL.

Mike
"Unintentional death of one civilian by the US is a tragedy; intentional slaughter of a million by Saddam - a statistic." - Unknown
Yes, it was the "using namespace std;", thanks!
http://www.stas.net/rafael/icq: 11915640

This topic is closed to new replies.

Advertisement