Solved

# Store Array of x,y coordinate elements

Posted on 2004-03-22

I have a function that takes an x an y coordinate as parameters

void storecoords(float x, floaty)

{

float Array[][2];

}

I need to store a number of x,y coordinates in an array such that:

Array [x1 ][x2][x3][x4][x5] ...

[y1 ][y2][y3][y4][y5] ...

i.e.

As the x y coordinates are recieved by the function I need to

1) check if the coordinates are in the array.

2) if if the coordinates are do nothing.

3) if the coordinates are not in the array: add the coordinates to the array.

n.b the array must be able to grow dynamically as more and more coordinates are added?

Any suggestions appreciated?

Thanks,