GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 12-Jun-2009, 13:00
MarshaBan MarshaBan is offline
New Member
 
Join Date: Jun 2009
Posts: 3
MarshaBan is on a distinguished road

For loop expression question


I ran across this expression in my textbook and I can't seem to find the answer in it.

In the expression:

for ( ;; )
{
//some iostream statements here
}

What does ;; represent in the For loop?

Thanks, MB
  #2  
Old 12-Jun-2009, 13:20
fakepoo fakepoo is offline
Regular Member
 
Join Date: Oct 2007
Posts: 696
fakepoo is a jewel in the roughfakepoo is a jewel in the roughfakepoo is a jewel in the rough

Re: For loop expression question


Basically, a for() loop has 3 sections in the parenthesis, each separated by a semicolon.

for( Do Once at the beginning of the loop ; Continue looping if this is true or blank ; Do once at the end of each iteration )

You can leave any of the sections out so for( ;; ) is simply a loop that goes on forever. If you want to exit this kind of loop, use the statement break; from within the loop.
  #3  
Old 12-Jun-2009, 13:31
MarshaBan MarshaBan is offline
New Member
 
Join Date: Jun 2009
Posts: 3
MarshaBan is on a distinguished road

Re: For loop expression question


Thank you very much.
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please, This is Difficult question try for me! bcompt143 C++ Forum 4 24-Aug-2008 10:14
Question on how to apply do while loop fishguts Java Forum 1 04-Oct-2007 12:21
Question about locking surfaces to directly access pixels, SDL. george89 C++ Forum 0 18-Jun-2006 22:16
Can enum have same name as class? crystalattice C++ Forum 3 08-Dec-2004 17:43
question of practice magiccreative C++ Forum 1 06-Feb-2004 08:17

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 00:55.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.