Polygon() C++(WIN32)
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?
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.
POINT points[3] = { {5, 5}, {55, 5}, {55, 55} }; should work fine.
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?
point[0].x = something;
point[0].y = something;
or
point[0] = POINT(something, something);
might work too.
point[0].y = something;
or
point[0] = POINT(something, something);
might work too.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement