home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP30-3.ZIP / EXAMPLES.ZIP / INTRO23.CPP < prev    next >
C/C++ Source or Header  |  1992-02-18  |  504b  |  31 lines

  1. // INTRO23.CPP--Example from Chapter 3, "An Introduction to C++"
  2.  
  3. #include <iostream.h>
  4.  
  5. int warning = -1;
  6.  
  7. int get_status(void)
  8. {
  9.    return warning;
  10. }
  11.  
  12. int main()
  13. {
  14.    int count = 10;
  15.    while (count-- > 1)
  16.    {
  17.       if (get_status() == warning)
  18.          break;
  19.       cout << '\n' << count;
  20.    }
  21.    if (count == 0)
  22.       cout << "Shuttle launched\n";
  23.    else
  24.    {
  25.       cout << "\nWarning received\n";
  26.       cout << "Count down held at t -  " << count;
  27.    }
  28.  
  29.     return 0;
  30. }
  31.