troubleshooting Question

Store Array of x,y coordinate elements

Avatar of XPUSR
XPUSR asked on
C
25 Comments1 Solution638 ViewsLast Modified:
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,



Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 25 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 25 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros