struct Vertex{
int num;
int low;
bool seen;
Vertex *parent;
Vertex(){
num = 0; low = 0; seen = false; parent = NULL;
}
};
This is the struct. The problem is that when i attempt to make an array of type Vertex, the debugger states it's of non-pointer class type. This is how I declare it:
Vertex *mark;
mark = new Vertex[numVert];
(mark is declared in the class and the assignment is done in the default constructor).
I've declared pointer arrays exactly like this before. What would be the reason that it does not work now?
Graph::Graph(int v){
int i;
numVert = v;
count = 0;
mark = new Vertex[numVert];
matrix = new int*[numVert];
for (i=0;i<numVert;i++){
mark[i]->seen = false;
matrix[i] = new int[numVert];
for (int j=0; j<numVert;j++)
matrix[i][j]=0;
}
}
This is where it is initially called. It states that it's of non-pointer type on both the assignment of the array and the assignment of its 'seen' member to false.