home *** CD-ROM | disk | FTP | other *** search
/ Shareware Supreme Volume 6 #1 / swsii.zip / swsii / 099 / IOSTREAM.ZIP / EX_I25.CPP < prev    next >
C/C++ Source or Header  |  1993-01-07  |  505b  |  28 lines

  1.  // EXAMPLE INPUT-25
  2.  
  3.  // TEST getline FUNCTION
  4.  
  5.  // NOTE THAT THE LAST DOUBLE QUOTE
  6.  // APPEARS ON THE FOLLOWING LINE
  7.  // DUE TO THE INCLUSION OF THE
  8.  // NEWLINE CHARACTER IN string
  9.  
  10.  #include <header.h>
  11.  
  12.  const int length = 100 ;
  13.  
  14.  int main()
  15.  {
  16.     char string [length] ;
  17.     const char quote = '\"' ;
  18.  
  19.     cout << "Enter a string: " ;
  20.     cin.getline(string , length) ;
  21.     cout << "Your string: "
  22.          << quote
  23.          << string
  24.          << quote ;
  25.  
  26.     return 0 ;
  27.  }
  28.