I can't seem to declare an ifstream on the heap.
My code reads:
ifstream* file; //protected
// in constructor
char* filepath="C:\\Sample_Data\\qry_Equip.txt";
file=new ifstream(filepath);
The error I'm getting tells me that the class has no constructors - it works on the stack, but I need it on the heap as I need to maintain the pointer's position.
It would get way to mesy as a quick-fix global.
Any help massively appreciated.
Douglas JL If it don't make you laugh, it ain't true.
My code reads:
ifstream* file; //protected
// in constructor
char* filepath="C:\\Sample_Data\\qry_Equip.txt";
file=new ifstream(filepath);
The error I'm getting tells me that the class has no constructors - it works on the stack, but I need it on the heap as I need to maintain the pointer's position.
It would get way to mesy as a quick-fix global.
Any help massively appreciated.
Douglas JL If it don't make you laugh, it ain't true.