2012-10-24, 04:40 PM
SaptaZapta Wrote:No.
You didn't define ch to always be wordfile[i]. C++ doesn't even have an easy way to do that, except as a macro, which is very highly frowned upon. You could use a pointer (char*) instead of an index, if you've learned how to do that.
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?

