Re: What's wrong ?
- From: Richard <devr_@xxxxxxxxx>
- Date: Thu, 06 Mar 2008 20:53:21 +0100
santosh <santosh.k83@xxxxxxxxx> writes:
CBFalconer wrote:
"Daniel.C" wrote:
I just copied this code from my book with no modification :
#include <stdio.h>
/* count characters in input; 1st version */
main()
int main(void)
{
long nc;
nc = 0;
while (getchar() != EOF)
++nc;
printf("%ld\n", nc);
return 0;
}
There is no output, and no completion either. I tried adding a
"printf" at the end of the code, but it doesn't display.
Your book is obsolete and wrong.
The example probably came from K&R2. So you are saying it's obsolete and
wrong. On what basis?
This should be good....
.
- References:
- What's wrong ?
- From: Daniel.C
- Re: What's wrong ?
- From: CBFalconer
- Re: What's wrong ?
- From: santosh
- What's wrong ?
- Prev by Date: Re: Variable length arrays
- Next by Date: Re: What's wrong ?
- Previous by thread: Re: What's wrong ?
- Next by thread: Re: What's wrong ?
- Index(es):
Relevant Pages
|