jeudi 25 janvier 2018

What is the difference between reading a file with >> operator and reading a file with read function?

#include <iostream>
#include <fstream>
using namespace std;
int main()
{
    ifstream obj;
    obj.open("a.txt");
    char i;
    obj.read((char *)&i, 1);
    cout << i;
    obj.close();

    return 0;
}

What is the difference between reading a file with >> operator and with the read function in c++?

Aucun commentaire:

Enregistrer un commentaire