Hi,
I am writing a little program in C++ that is used to read a file which contains several paragraphs. The paragraphs are not indented and there are a blank line or sometimes two blank lines before the start of each paragraph.
I have written the program and can read and dump the file into a new file.
Aside from the basic reading of the file and closing the file, I have a while loop with a getline to read each line. I have put an If else statement into it so as I can indent the start of a new paragraph when there is one.
The problem that I am having is I do not know what to put into the "if()" statement to denote the end of blank lines so that I can indent some sppaces. I have searched, read and searched some more for some answers on my own and finally came here for a tip.
Please help me!
Thank you
Here is the While statement that I have going on so far:
while(inFile)
{
getline(inFile,inputStr);
if ()
{
outFile << " " << inputStr << endl;
}
else
{
outFile << inputStr << endl;
}
}