i was writing a part of a program to scan a file and store a copy of its contents in a dynamic char array and its size in an int variable and be able to access this information and the problem i encountered in the .cpp file was that i couldn't use tellg() as it simply stated that "variable tellg() is undefined" i think the problem is that the location of the file i give isn't a constant but a string that have yet to be passed (empty before the program is run) and would like to know if there is any way to fix it (the file i read from is going to be a .txt file)
.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#ifndef File_Scanner
#define File_Scanner
#include<iostream>
class Scanner {
private:
char* File_Copy;
int File_Size;
public:
~Scanner();
void Scan_File(std::string& File_Location);
int Get_File_Size();
char& Get_File_Copy_Address();
};
#endif