We help IT Professionals succeed at work.

c++ question about vectors and Visual c++

basil365
basil365 asked
on
Hi,

I'm translating a program from c# into c/c++ (I have little experience in either). In the the c# app there is a list of user defined objects, to replicate this i have created a struct with the same fields as the c# object.

Would a vector be the best method to replicate a list functionality (i.e. add/remove/clear)?

Also i'm doing this in visual studio and for some reason vector isn't appearing in my intellisense. I have added an include (#include <vector>), do i have to add a project reference to some library in order to use vectors?

Thanks in advance
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2012
Commented:
You should refer to the 'std' namespace to make that visible for IntelliSense (or use the 'std::' prefix), i.e.
#include <vector>
#include <list> // if you really want a list ;o)
using namespace std; // this will help

Open in new window

Author

Commented:
perfect, thanks - had completely forgotton about 'std'

Explore More ContentExplore courses, solutions, and other research materials related to this topic.