please dont rip this site

Language Ccpp Cppref Examples IO2.CC

/ ************************************************************************
 *
 * Purpose:
 * Author:  M J Leslie
 * Date:    26-Oct-98
 *
 ************************************************************************/


#include <fstream.h>                // ifstream, ofstream, fstream
#include <iostream.h>               // cin, cout

main()
{
  char buf[255];
  char File[]="tempfile";
  
  cout << "Please enter a string => ";      // O/P to STDOUT (screen).
  cin >> buf;                   // Read from STDIN (keyboard).
  
  cout << " Writing string to " << File << "\n";
  
  ofstream fp(File);                    // Open file for O/P
  fp << buf << "\n";                // Write to the file.

        // ... File is closed at program end.
}


file: /Techref/language/ccpp/cppref/EXAMPLES/io2.cc, 0KB, , updated: 1998/10/27 13:57, local time: 2024/4/27 05:25,
TOP NEW HELP FIND: 
3.137.171.121:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://techref.massmind.org/techref/language/ccpp/cppref/EXAMPLES/io2.cc"> language ccpp cppref EXAMPLES io2</A>

Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to techref.massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .