Как следует из названия, у меня есть текстовый файл, в котором практически нет заглавных букв, поэтому все предложения не выглядят правильно, если первая буква не заглавная. Вот мой код:
//This program reads an article in a text file, and changes all of the
//first-letter-of-sentence-characters to uppercase after a period and space.
#include <iostream>
#include <fstream>
#include <string>
#include <cctype>//for toupper
using namespace std;
int main()
{
//Variable needed to read file:
string str;
string input = str.find('.');
//Open the file:
fstream dataFile("eBook.txt", ios::in);
if (!dataFile)
{
cout << "Error opening file.\n";
return 0;
}
//Read lines terminated by '. ' sign, and then output:
getline(dataFile, input, '. ');//error: no instance of overloaded function "getline"
//matches the argument list
//argument types are:(std::fstream, std::string, int)
while (!dataFile.fail())
{
cout << input << endl;
getline(dataFile, input);
}
//Close the file:
dataFile.close();
return 0;
}
. ПРИМЕЧАНИЕ. Я знаю, что в моем коде еще нет ключевого слова toupper. Я пока не знаю, где его установить.
input = str.find('.');
? - person Thomas Matthews   schedule 08.10.2014while (getline(datafile, input, '.'))
Вы не можете поместить более одного символа между одинарными кавычками, используйте двойные кавычки. - person Thomas Matthews   schedule 08.10.2014