I am trying to read the file and store it in an array.
Here's the part of code I am using to open the file:
int readFile(AccessRecord & file, Files & namesIn)
{
std::ifstream fin(file.fileName);
if (fin.fail())
return -1;
}
this is the new error I am getting when I go to compile:
[meg21allred@LinuxLab08 ~]$ g++ myAssign02.cpp
myAssign02.cpp: In function ‘int readFile(AccessRecord&, Files&)’:
myAssign02.cpp:72:35: error: no matching function for call to
‘std::basic_ifstream<char>::basic_ifstream(std::string&)’
std::ifstream fin(file.fileName);
if I just use std::cout << file.fileName;
, it seems to print out the correct fileName but it doesn't like it when I put file.fileName
into ifstream line