Ask Your Question

Revision history [back]

click to hide/show revision 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()