a out in c++ example
Example 1: file objects in c++
// basic file operations
#include <iostream>
#include <fstream>
using namespace std;
int main () {
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile.close();
return 0;
}
Example 2: get data from terminal c++
int i;
cout << "Please enter an integer value: ";
cin >> i;