• Advertisement
Sign in to follow this  

Polygon() C++(WIN32)

This topic is 4621 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
point[0].x = something;
point[0].y = something;

or

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

might work too.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement