home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / c / 12686 < prev    next >
Encoding:
Text File  |  1992-08-23  |  917 b   |  33 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!mcsun!fuug!ositech.fi!gml
  3. From: gml@ositech.fi (Mikael Lonnroth)
  4. Subject: Re: Question about code in Kernighan and Ritchie book
  5. Message-ID: <gml.26.0@ositech.fi>
  6. Lines: 20
  7. Sender: usenet@fuug.fi (USENET News System)
  8. Nntp-Posting-Host: ositech.fi
  9. Organization: Ositech Oy
  10. References: <66653@hydra.gatech.EDU>
  11. Date: Mon, 24 Aug 1992 00:40:55 GMT
  12.  
  13. In article <66653@hydra.gatech.EDU> gt5870c@prism.gatech.EDU (Noah White) writes:
  14.  
  15. >do not appear to work, when I run them it takes in the input fine but doesn't
  16. >print anything out. As I am new to c I thought one of you net guru's could
  17. >help me out:
  18. .
  19. .
  20. .
  21. >    while ((c = getchar()) != EOF)  {
  22. .
  23. .
  24. .
  25. >        printf("%d %d %d\n", nl, nw, nc);
  26.  
  27. The program does not exit from the while loop before you type an EOF on
  28. your keyboard (MSDOS ^Z, UNIX ^D). Maybe that is the problem?
  29. --
  30. gml@ositech.fi
  31. Georg M. Lönnroth
  32. Espoo, Finland
  33.