Hello everyone,
I have a question about the getline() function. I want to read from a text file and add each sentence to a string array, separating them by the full-stop.
The getline() function format for input from a text file is different from the one that takes keyboard input. The keyboard input one allows the use of delimiters to separate the input, but the file input format does not.
char test[100];
cout << "Input: ";
cin.getline (name,100,/*delimiter*/);
// as opposed to
ifstream i;
i.open("test.txt");
string s;
getline(i,s);
i.close();
so the question is, is it possible to add the delimiter to the txt file input version as well? if so how?