This didn't even compile, since there was an error. It also gave me a bunch of warnings:
Code:
/*
main.cpp||In function 'int main()':|
main.cpp|9|warning: left-hand operand of comma has no effect|
main.cpp|10|warning: left-hand operand of comma has no effect|
main.cpp|11|warning: left-hand operand of comma has no effect|
main.cpp|12|warning: left-hand operand of comma has no effect|
main.cpp|13|warning: missing braces around initializer for 'POINT'|
main.cpp|13|warning: missing braces around initializer for 'POINT'|
main.cpp|15|error: 'i' was not declared in this scope|
||=== Build finished: 1 errors, 6 warnings ===|
*/
The "missing braces around the initializer" are the key to your problem. Use braces, not parenthesis:
Code:
POINT points[5] = {{xCoord, yCoord},
{xCoord, yCoord-50},
{xCoord+50, yCoord-50},
{xCoord+50, yCoord}
};