Polygon Drawing

hello guys. I am stuck in a part of my assignment where I have to use a function which draws a polygon. The parameters of the function are

 
  void drawpoly(int numberOfPoints, int *points);


The problem is that upon mouse click, I get two coordinates, x-axis and y-axis. Can anybody tell how can I convert the two points into a single point? Thankyou
closed account (j3Rz8vqX)
Depends how you're going to use this "points".

Sounds like you're passing it an array.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void drawpoly(int numberOfPoints, int *points)
{
    //Do something...
}
int main ()
{
    int x=5;
    int y=7;
    int arry[2];
    arry[0] = x;
    arry[1] = y;
    drawpoly(2,arry);

    return 0;
}
Thanx alot buddy :D you solved my problem :)
Last edited on
Topic archived. No new replies allowed.