1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
int main()
{
ifstream inFile;
ofstream outFile;
int words, lines, paragraphs;
char ch;
initialize(words, lines, paragraphs);
inFile.open("C:\\Users\\Joel\\Documents\\Visual Studio 2010\\Projects\\C++ Exercises\\Ch07\\7-7\\Input.txt");
outFile.open("C:\\Users\\Joel\\Documents\\Visual Studio 2010\\Projects\\C++ Exercises\\Ch07\\7-7\\Output.txt");
inFile.get(ch);
while (inFile)
{
outFile << ch;
if (ch == ' ')
processBlank(words, ch, inFile, outFile);
else if (ch != '\n')
copyText(ch, inFile, outFile);
else if (ch == '\n')
updateCount(words, lines, paragraphs);
inFile.get(ch);
}
inFile.close();
printTotal(words, lines, paragraphs, outFile);
outFile.close();
return 0;
}
|