I'm trying to create a while loop with an 'or'.
The program runs fine without the 'or' but when I add it, the program outputs nothing. Here is the loop in question:
I want it to execute the loop while sentence[pos] is not a space, or a period. When I add in then part about not being a period, it seems to kill the loop. Is this improper syntax?Code:while ( (sentence[pos] != ' ') || (sentence[pos] != '.') ) { count++; pos++; }