This is the beginning portion of an assignment I'm working on. I'm not familiar with structures yet so I just want to know if I've created the beginning portion correctly. The corresponding portions in bold are the statements that I'm not sure if I've followed the guidelines correctly.
The beginning description:
Start by defining two structure types. All structure types must be documented by saying (1) what a value of this structure represents and (2) what each field represents.
A structure of type Edge represents one edge in a graph. It has three fields: two vertex numbers and a weight. Include a parameterless constructor that sets all three fields to 0.
A structure of type Graph represents a weighted graph. It has four fields:
the number of vertices in the graph, the number of edges in the graph, an array of Edges that holds the edges, the physical size of that array of edges. Include a constructor Graph(nv) that yields a graph with nv vertices and no edges. The constructor must create the array of edges. You can assume that there are no more than 100 edges, but that number must be easy to change. To increase this to 200, for example, should only require changing one line of your program. To achieve that, create a named constant that is the maximum number of edges. For example,
const int maxEdges = 100;
defines constant maxEdges with a value of 100. Any time you need to refer to the maximum number of edges, use maxEdges, not 100.
My development plan for the said description:
struct Edge { int vertex1; int vertex2; int weight; Edge() { vertex1 = 0; vertex2 = 0; weight = 0; } }; struct Graph { int numOfVert; int numOfEdge; int arrayOfEdge[]; const int maxEdges = 100; Graph(int nv) { numOfVert = nv; numOfEdge = 0; arrayOfEdge[maxEdges]; } }; I just want to know if I've completely understood what the description is telling me to do. Appreciate any help.