samedi 12 août 2017

variable std::fstream file has initializer but incomplete type Compilation error

This is the file where the compiler shows where the error is. I have searched the same error online, most of them is caused by not including the< fstream >, but here I have included it, it still showing this error.

#include <iostream>
#include <fstream>
#include "MyFile.h"
using namespace std;
using namespace sict;
int main() {
    fstream file("ms3.txt", ios::out);
    file << "one" << endl << "two" << endl;
    file.close();
    MyFile F("ms3.txt");
    F.load(file);
    cout << "Linear: " << F << endl;
    cout << "As is: " << endl;
    F.print();
    cout << "Enter the following: " << endl << "three<ENTER>" << endl <<     "four<ENTER>" << endl << "Ctrl-Z<ENTER>" << endl << endl;
    cin >> F;
    F.store(file, true);
    F.load(file);
    cout << F << endl;
    F.print();
    return 0;
}

Aucun commentaire:

Enregistrer un commentaire