Hello everybody :) I have a really simply C++ question.
I have a txt file which decribes geometric shapes name and the cordinates
First number describes how many corrdinates are in that line for example first line is 6 so there are 6 coordnates and so on
int circles = 0; // how many circles
while(!fd.eof()){
fd >> name >> n; // n how many coordinates in that line
f.SetName(name);
f.SetN(n);
if(n==3){
fd >> x >> y >> s;
f.SetCircle(0, x, y, s);
circles++; // add circles number by 1
}elsefor(int i=0; i<n/2; i++){
fd >> x >> y;
f.SetKord(i, x, y);
}
fgk.Set(f);
}
fd.close();
}
If all you need is how many figures and what their names are, why do you even need the coordinates? Obviously you have three figures: a triangle, a circle, and a square.