1 | initial version |
try with a std::ifstream:
#include <fstream>
using namespace std;
ifstream in("my.txt");
int x,y,w,h;
char comma; //dummy
vector<Rect> rects; // result
while ((in >> x) && (in >> comma) &&
(in >> y) && (in >> comma) &&
(in >> w) && (in >> comma) &&
(in >> h)) {
rects.push_back(Rect(x,y,w,h));
}
in.close()