Jump to content
  • Advertisement
Sign in to follow this  
ender_341

Polygon() C++(WIN32)

This topic is 4894 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!