Taking an input file and doing calculation

I am trying to work on a C++ program to calculate the quadratic formula using input files and classes. I have written my class, but I am trying to find a way to take an input file with unknown number of lines of coefficients. How do I take each integer from each line and set that value as "a" and "b" and so forth, then start over on the next line?

This is what i have so far.
fstream inputfile;//users input quadratic coefficients file
ofstream outputfile;// outputs a file with solutions

int main(int argc, char *argv[])// argc is argument count, char *argv[] is array of array of characters for arguments
{
string dataline;
getline(inputfile, dataline);

inputfile.open(argv[1]);//opens file of quadratic coefficient data
outputfile.open(argv[2]);//opens file to place quadratic solutions

if(inputfile.is_open())// only do below if the file opens
{
while(!inputfile.eof())//keep going tell the file is done
{
while(getline(inputfile, dataline))
inputfile.getline(dataline,600,'/n'); //gets characters from input file
if(!inputfile)break; //will stop break loop
{

}
what is the format of the contents of your input file?
Topic archived. No new replies allowed.