difference between Vector of pointers declaration

I was wondering what difference between
vector<StructName*>Variablename_; and vector<StructName>* Variablename_;

For example, let's say I have a class Path and inside I have a struct vertices:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class Path{
Public:

//functions

Private:
struct Vertices{
   int vertex;
   bool visit;
   int weight;
   Vertices* path;

} 
vector<Vertices*>node;

}
Last edited on
vector<StructName*>Variablename_; // A vector of pointers to StructName

http://stackoverflow.com/questions/2853438/c-vector-of-pointers

vector<StructName>* Variablename_; // A pointer to a vector of StructName

http://stackoverflow.com/questions/6946217/pointer-to-a-vector



Last edited on
So if I am trying to make an adjacency list using a vector
vector<StructName*>Variablename_; would be the way to do. right?

IS there a way I can visualize this? I think I am a little confused
Last edited on
Topic archived. No new replies allowed.