summaryrefslogtreecommitdiff
path: root/reference/CPLUSPLUS/EXAMPLES/io2.cc
blob: 53484a7ebf8642538e7d27c096820944832323e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/************************************************************************
 *
 * 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.
}
ent90735c99edfa1968a3e8da26a0b471a59fbc0f57 (diff)parent9f05e6219023116b59f6495e8c4d4ba352dd5fea (diff)
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: - a bigger fix for i801 to finally be able to be loaded on some machines again - smaller driver fixes - documentation update because of a renamed file * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: mux: reg: Provide of_match_table i2c: mux: refer to i2c-mux.txt i2c: octeon: Avoid printk after too long SMBUS message i2c: octeon: Missing AAK flag in case of I2C_M_RECV_LEN i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR
Diffstat (limited to 'Documentation')