home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16879 < prev    next >
Encoding:
Text File  |  1992-11-20  |  1.4 KB  |  35 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!cs.yale.edu!rtnmr.chem.yale.edu!rescorla
  3. From: rescorla@rtnmr.chem.yale.edu (Eric Rescorla)
  4. Subject: Re: C for loop
  5. Message-ID: <1992Nov20.160200.11698@cs.yale.edu>
  6. Sender: news@cs.yale.edu (Usenet News)
  7. Nntp-Posting-Host: rtnmr.chem.yale.edu
  8. Organization: Rescorla for himself.
  9. References: <Bxzonp.2oH@research.canon.oz.au> <3892@dozo.and.nl> <1992Nov20.134343.4978@magnus.acs.ohio-state.edu>
  10. Date: Fri, 20 Nov 1992 16:02:00 GMT
  11. Lines: 22
  12.  
  13. In article <1992Nov20.134343.4978@magnus.acs.ohio-state.edu> ckkoo@magnus.acs.ohio-state.edu (Chee K Koo) writes:
  14. >I am new to C programming, while i was doing a numerical analysis
  15. >program which uses many for loop
  16. >here is the loop looks like
  17. >for(i=1;i<=n;i++);
  18. >{
  19. >}
  20. >i put the ";" after the loop header, when the program is excuted, the loop
  21. >is skipped, however, it works fine when the ";" is removed.
  22. >I just want to find out why the compiler does not catch it during
  23. >compilation. It is compiled with UNIX gcc.
  24. Because it's perfectly legal, and not even guaranteed to be stupid.
  25. -Ekr
  26.  
  27.  
  28.  
  29.  
  30. -- 
  31. -------------------------------------------------------------------------------
  32. Eric Rescorla, DoD#431 (Nighthawk S)              rescorla@rtnmr.chem.yale.edu
  33. Former chemist now CM400 mechanic                 ekr@eitech.com(preferred)
  34.                 "Meet the new boss, same as the old boss."
  35.