0

So I want to open a file and get each word from every line of the file. Each line in my file represents a point, so the first word in the line its his name and every other word its a number which represents one of its dimensions(the dimensions vary,which means that maybe there are 2,3,5 etc and all the points in the file have the same dimensions). For example the file might have this form:

id1 5 4 3 6
id2 7 8 2 3
id3 4 2 9 1

I have created a class Database and a class Point so I can save the words from each line at the class Point and then I will add each Point in my Database. The code from the classes is this:

class Point(){
public:
    string itemId;
    vector<float> array;
};

class Database(){
public:
    vector<Point*> database;
    void addPoint(Point*);
    void cleanup();
    ~Database();
};

0 Answers0