You can store all the x and y pairs as a
vector
of
POINT
structures.
std::vector<POINT> ptGraph;
You can then use the GDI
Polyline[
^] to draw the entire graph in one shot.
If you have multiple lines to be drawn, you can use the
PolyPolyline[
^] function.
If you can use GDI+, you the
Graphics::DrawPolygon[
^] function.