Thx swoopy. I don't think I need double pointers. Don't even know what that is!
I figured it out though. Just needed to dynamically declare vertices in the loop.
And now I am trying to do a bubble sort of the data read in but it's giving me grabage values. w/o the bolded lines of code, the output is correct (unsorted of course) so is it not possible to swap structures like that?
Code:
// Sort the vertices according to the angle of the relative polar coordinates
void sortVertices(Vertex* vertices[], int nPts)
{
Vertex temp;
bool exchange;
do
{
exchange = false;
for (int counter=0; counter < nPts; counter++)
if (vertices[counter]->polar.theta > vertices[counter+1]->polar.theta)
{
vertices[counter] = new Vertex;
temp = *vertices[counter];
*vertices[counter] = *vertices[counter+1];
*vertices[counter+1] = temp;
exchange = true;
cout<<vertices[counter]->polar.d<<" "<<vertices[counter]->polar.theta<<" "<<endl;
}
nPts--;
}
while (exchange == true);
}