Please help me to build a polygon.

May 26, 2014 at 10:26pm
Solved
Last edited on May 30, 2014 at 8:51am
May 27, 2014 at 8:34am
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.