Please help me to build a polygon.

Solved
Last edited on
can we take input edges from user???
Sure. Use cin

http://www.cplusplus.com/reference/iostream/cin/

and a loop for the 4 points, like so

1
2
3
4
5
6
7
for(int i = 0; i < 4; ++i)
{
  cout << "X: ";
  cin >> points[i * 2];
  cout << "Y: ";
  cin >> points[(i * 2) + 1];
}
Topic archived. No new replies allowed.