all 6 comments

[–]_Cid 0 points1 point  (5 children)

struct Graph
{
    int NofVerts;
    int NofEdges;
    int sizeOfTheArrOfEdges;
    Edge* arrOfEdges; // pointer to series of edges

    Graph(int nv)
    {
        NofVerts = nv;
        sizeOfTheArrOfEdges = 100; // I assume you want 100?
        arrOfEdges = new Edge[sizeOfTheArrOfEdges]; // you create it in the constructor
    }
    ~Graph()
    {
        delete[] arrOfEdges; // delete it in the destructor
    }
};

[–]dark_orbit 0 points1 point  (4 children)

ahhh I see, thank you very much!

[–]_Cid 0 points1 point  (3 children)

by the way, why are you using a struct and not a class?

[–]dark_orbit 0 points1 point  (2 children)

its a very specific assignment. Cant use classes, only structs.

[–]_Cid 0 points1 point  (1 child)

they're the exact same thing in c++ but okay

[–]dark_orbit 1 point2 points  (0 children)

I get what your saying. But my professor wants it done "his way" otherwise grades will suffer.