| BReynolds (25) | |||||
|
Note: Using Code::Blocks on Windows. I am trying to get some (x, y) coords from a .txt file, sort them by their distance from the main (x, y) coord, and then save them to another .txt file. I put the coords from the file in a list<pair<int, pair<int, int> > >. The first int is the distance from the main coord. The other two ints are the coords from the file.Once I get these things into the list and the distances calculated (using a^2 + b^2 = c^2. I leave it in c^2 form), I try to see what I have so far in the unsorted list by printing it all out. Like so:
However it only prints one thing out that is not even anything in the .txt file. What is going on, and how can I fix it? Full Code.
| |||||
|
|
|||||
| ne555 (4386) | |||
I suggest you to limit the scope of your variables
| |||
|
|
|||
| BReynolds (25) | |
|
Wow all this trouble over a semicolon... Thank you for pointing that out... I feel so dumb now. Well this is solved. I just needed an extra pair of eyes. Again thank you. | |
|
|
|