Getting this weird error: unknown type name 'fsteam'


ROOT Version: 6.30.2
Platform: Windows10


I’m getting this error when trying to read a data file data.txt. I’m new to Root, I don’t know where is the problem and no one seemed to get this error. Can anyone help me ? This is my code:

#include <iostream>
#include <fstream>

void main()
{

	TH1F *hist = new TH1F("hist", "Histogram", 20, 0, 10);
	fsteam file;
	file.open("data.txt", ios::in);
	
	double value;
	
	while(1)
	{
		file >> value;
		hist->Fill(value);
		if(file.eof()) break;
	}
	file.close();
	
	TCanvas *C1 = new TCanvas();
	hist->Draw();
}

and the error is simply; unknown type name ‘fsteam’

Sorry if it’s a very basic question.

Try with fstream instead of fsteam

I’s so dumb, thanks

1 Like