How do you skip over spaces while inputting from a text file?
Code:
#include <iostream>
#include <fstream>
#include <vector>
#include <conio.h>
using namespace std;
struct Triangle {
float a, b, c, d, e, f, g, h, i;
};
vector<Triangle*> TriangleVector;
int main(void) {
ifstream fin;
fin.open("Coordinates.txt");
if(fin.fail()) {
cout << "Could not load coordinates" << endl;
cout << "Hit a key to escape" << endl;
getch();
return 0;
}
int x = 0;
while(!fin.eof()) {
TriangleVector.push_back(new Triangle);
//THIS IS WHERE I NEED HELP WITH SCANNING AHEAD
//Scan ahead two spaces, input TriangleVector[x]->a, tab ahead another space, input TriangleVector[x]->b, and so on
}
getch();
fin.close();
return 0;
}