Here is the code i am working with right now. It is going to read in a number of lines of 3 ints that will be the x, y, and radius of a circle. However the number of lines read in isn't set is there a way for me to make a counter and then have it create circle 0 the first time through then circle 1,2,3..... until EOF? If you have any ideas on how to solve this problem I would very much appreciate it.
ifstream myfile;
myfile.open("input.txt");
if (myfile.good()) {
string line;
getline (myfile,line);
if(line == "Code 1"){
int i=0;//moved here because it increment in the loop.
while(!myfile.eof()){
double a,b,c;
myfile>>a;
myfile>>b;
myfile>>c;
//I dont know the spec of Circle2d
//I assume void Circle2d(int i, double x, double y, double radius)
Circle2d(i, a, b, c);
++i;
}
}
}