Plotting a txt file

Every time I tried to plot a histogram with a data it shows error in fstream, not sure if the error is on root or the C program.
rror: no matching constructor for initialization of ‘std::__1::fstream’ (aka


TH1F *hist = new TH1F("hist","Histogram",100,0,100);
fstream file;"C07.txt", ios::in);
double value;
        hist -> Fill(value);
        if (file.eof())break;

    hist ->GetXaxis() ->SetTitle("data");
    hist ->GetYaxis()->SetTitle("Percentage");    

    TCanvas*c1 = new TCanvas();
    hist ->Draw();


Try with

ifstream file;"C07.txt");
1 Like