Inside of the text file
-- start of text file ----
Physics 0 Chemistry 1 English 2
----end of text file
class Book
{
private:
string title;
int category;
};
1) I want to store physics, chemisty, English to title; and 0,1,2 to a category;
ex, physics is category 0 chemisty is category 1 English is category 2
what I have...
string title;
string number;
if(book_input.is_open())
while(!book_input.eof())
{
getline(book_input, title, '\n');
getline(book_input, number, '\n');
Book list(title, number);
}
Is this a good way to store it??