This is making no sense to me, but hopefully one of you understand why it's doing this.
I have an assignment that requires three characters be read with getchar() as the three integers next to one another are relevant to each other, so I set up a loop structured as such:
int c1, c2, c3 = 0;
while(c3 != EOF) {
c1 = getchar();
c2 = getchar();
c3 = getchar();
... do something with them...
}
The problem is that if the amount of characters is not divisible by three, the last iteration is not executed. So, if the characters "Abcd" were entered, it would do the first iteration on Abc, but the second iteration wouldn't do anything with D. Same for "Abcde", but Abcdef would work.
This is a homework assignment so don't solve the problem for me, but is this something weird about getchar that it just terminates the loop if that many characters aren't found?