>I am not sure how to isolate the first 4 points so I can
How about changing getdata just a wee bit.
void getData(double& n)
{
if ( infile >> n )
{
cout << "number = " << n << endl;
}
}
And then inmain actually passing the parameters you want to get (once you've made a slight change) to this function.
double x1, x2, y1, y2;
// ...
while ( infile )
{
getData(x1);
getData(x2);
getData(y1);
getData(y2);
doCalc();
}
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
>But I need to assign every fourth digit x1, and so on.
Uh, this is being done in the code I posted. (I should have done better error checking, but I didn't want to confuse you further.)
You weren't expecting us to fill in the blanks for you on the remaining functions, were you? I showed how the doCalc ought to move into this loop, thinking you could pick up on it, fill in some of that code, and take the initiative to put the printScreen function there as well.
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314