If you want to leave a statement blank, just use two ;'s. so: for (int i=0;;i++) not sure why you'd want to do this--I've seen some really weird for loops in the past though, so. Have at it.
Thanks, Tyler Littlefield email: [EMAIL PROTECTED] web: tysdomain-com Visit for quality software and web design. skype: st8amnd2005 ----- Original Message ----- From: Thomas Hruska To: [email protected] Sent: Friday, October 17, 2008 9:23 PM Subject: Re: [c-prog] for statement gah15920722 wrote: > I want to know when I use a for statement,how many ;should I use? > What if I only use two statements? > Why? Why are you asking this question (i.e. what caused you to ask this in the first place)? You should use as many for-loops as is needed. However, if you start nesting too deeply (e.g. 4 or more deep), then there is probably something wrong with the design. Although, depending on the scenario, it could be just fine - you would want to run some performance tests and maybe move the inner loops into function calls to help make the code more readable. Functions incur some slight overhead - but there are performance tricks like 'inline' to help alleviate the problem and they help organize your code. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/ [Non-text portions of this message have been removed]
