Error: use of undeclared identifier 'fileNameIn' ROOT 6.11/01

Hello,

I try to run the macro to read a file.txt

in the macro :

#include <fstream> ` (It's not enough to solve the problem)`
...
  ifstream fileIn("data_com_2_colunas.txt"); //arquivo com os dados 
  if(!fileIn){
    cout<<"Could NOT Find File: "<<fileNameIn<<endl;
  }

The error:

error: use of undeclared identifier 'fileNameIn'
    cout<<"Could NOT Find File: "<<fileNameIn<<endl;

I think to solve this problem is find the include to the function fileNameIn in root 6

Someone can help me?

Thanks!

Replace:

   cout << "Could NOT Find File: " << fileNameIn << endl;

by

   cout << "Could NOT Find File: data_com_2_colunas.txt" << endl;

Hi, bellenot.

Thanks for the answer, this work well!

Cheers,
André

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.