do statement

   
do statement Test-at-bottom loop statement

  statement  := do  statement  while (  expression  ) ; 

The do statement is a loop that executes statement , then tests expression . The loop iterates while expression is true and ends if expression is false. The loop body always executes at least once.

Example

  do  {   cout << "Number: ";   if (cin >> num)     data.push_back(num); } while(cin); 

See Also

break , continue , expression , for , statement , while , Chapter 4

   


C++ in a Nutshell
C++ in a Nutshell
ISBN: 059600298X
EAN: 2147483647
Year: 2005
Pages: 270
Authors: Ray Lischner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net