I have this constructor
class Vertex
{
Vertex();
~Vertex();
Edge* adjacencies;
};
I wanted there to be array of adjacencies, but it couldn't build. So I've created a pointer (Edge is my created class too).
And I have this piece of code with foreach loop that must iterate on all adjacencies, but, of course, it not compiles.
Vertex getted_vertex = vertexQueve.top();
for(Edge & e: getted_vertex.adjacencies)
{
Vertex v = Vertex(e._idFrom);
}
Should I change the constructor or the loop?
std::vectorand you can have everything you want from an array.