I have a small snippet of code below that I'm running using PellesC.
When the code is executed and I've typed a few characters into the console, I press enter.
Can you explain to me why the printf("%ld
", nc);
line doesn't seem to get executed? As no output is written to the console.
#include <stdio.h>
int main(void)
{
long nc = 0;
while(getchar() != EOF)
{
++nc;
}
printf("%ld
", nc);
}
I've decided to learn C thoroughly using the K&R book and I'm embarrassed to say this rather elementary example has me stumped.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…