File Stream C++ Tutorial

#include 
#include 
#include 
using namespace std;
int main() {
    fstream inout( "invoice.dat", ios::in | ios::out );                      
    inout << 1234 << " " << 56.78 << " " << "apples" <<'\n';                 
    cout << inout.tellg() << endl;                                      
    cout << inout.tellp() << endl;                                      
    inout.seekg( ios::beg );                                            
    cout << inout.tellg() << endl;                                      
    
    cout << inout.tellp() << endl;                                      
    int x;
    double y;
    string z;
    inout>> x >> y;                                                     
    inout >> z;                                                              
    cout << x << " " << y << " " << z << endl;                               
    return 0;
}