Polygon() C++(WIN32)

Started by
2 comments, last by chad_420 18 years, 11 months ago
POINT points[3]; points[0] = { 5, 5 }; points[1] = { 55, 5 }; points[0] = { 55, 55 }; Polygon(hDC, points, 3); When i use this code i get a bunch of errors about missing {'s, }'s, and ;'s in that code block,Does anyone know whats wrong with it?
-Matt S.
Advertisement
Initialization using curly braces ({ and }) has to be done on the line that you define the variable.

POINT points[3] = { {5, 5}, {55, 5}, {55, 55} }; should work fine.
Ra
Thanks, that fixed the problem in the program. What about if i later wanted to change a point, how do I update points after the declaration?
-Matt S.
point[0].x = something;
point[0].y = something;

or

point[0] = POINT(something, something);

might work too.

This topic is closed to new replies.

Advertisement