2012-10-24, 04:12 PM
That's not how you do an or.
Must write
or, even clearer
C is quirky in that the way you wrote it compiles without warning, but it does not do what you think it does.
Also, in your loop, you advance i, but do not recompute ch.
Must write
Code:
if (ch == '?' || ch == '.' || ch == ';' || ch == ':' || ch == '!')or, even clearer
Code:
if ((ch == '?') || (ch == '.') || (ch == ';') || (ch == ':') || (ch == '!'))Also, in your loop, you advance i, but do not recompute ch.

