c++ - boolean declaration for a template -
my datatype vertex v , using template.
vector<vertex*>* graph::path(vertex* v1, vertex* v2) { vertex* temp; queue<vertex*>* q; q->push(v1); bool *visited = new bool[v1]; }
the lastly line showing error asking input integral arguments only. how improve??
you cannot come in pointer in new bool[v1]
- assignment. need integer value (like 3,4, etc.) or lvalue has appropriate integer rvalue e.g. int c= 5; int s[] = new int[c];
. pretty syntanctical code of conduct.
c++ templates vector boolean
No comments:
Post a Comment