home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_11_07 / 1107107a < prev    next >
Text File  |  1993-05-04  |  444b  |  23 lines

  1. // incore.cpp:  Incore formatting
  2. #include <iostream.h>
  3. #include <strstream.h>
  4. #include <stddef.h>
  5.  
  6. main()
  7. {
  8.     const size_t BUFSIZ = 128;
  9.     char s[BUFSIZ];
  10.     int i;
  11.     
  12.     cout << "Please enter an integer: ";
  13.     cin >> i;
  14.     ostrstream(s,sizeof s) << "You entered " << i << ends;
  15.     cout << "s == \"" << s << "\"\n";
  16.     return 0;
  17. }
  18.  
  19. // Sample Execution
  20. // Please enter an integer: 10
  21. // s == "You entered 10"
  22.  
  23.