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

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!ckkoo
  3. From: ckkoo@magnus.acs.ohio-state.edu (Chee K Koo)
  4. Subject: C for loop
  5. Message-ID: <1992Nov20.134343.4978@magnus.acs.ohio-state.edu>
  6. Sender: news@magnus.acs.ohio-state.edu
  7. Nntp-Posting-Host: magnusug.magnus.acs.ohio-state.edu
  8. Organization: The Ohio State University
  9. References: <3870@dozo.and.nl> <Bxzonp.2oH@research.canon.oz.au> <3892@dozo.and.nl>
  10. Date: Fri, 20 Nov 1992 13:43:43 GMT
  11. Lines: 18
  12.  
  13. I am new to C programming, while i was doing a numerical analysis
  14. program which uses many for loop
  15. here is the loop looks like
  16.  
  17. for(i=1;i<=n;i++);
  18. {
  19. }
  20.  
  21. i put the ";" after the loop header, when the program is excuted, the loop
  22. is skipped, however, it works fine when the ";" is removed.
  23.  
  24. I just want to find out why the compiler does not catch it during
  25. compilation. It is compiled with UNIX gcc.
  26.  
  27. Thanks
  28.  
  29. C. K. koo
  30.  
  31.