2012-10-24, 04:46 PM
Imagine Wrote:Haven't learned indexes yet. In order for ch to always be defined as wordfile[i], can I just define it before the if statement like:
Code:ch = wordfile[i];
if (ch == '?' || ch == '.' || ch == ';' || ch == ':'||
ch == '!' ) {
++sentencecount;
++i;
}
And is there a reason why this text is affecting wordcount and lettercount even though they aren't determined by the same variables?
1. Yes. And that's not a definition, that's an assignment. You give it a value.
2. Does your input file have empty lines after the line of text?

