我正在尝试读取文件,所以正在这样做:-
void Load(const char * Name){
fs.open(Name, std::ifstream::in);
char temp[256];
if(fs.is_open()){
while (!fs.eof())
{
fs.getline(temp , 256);
Lines.push_back(new std::string(temp));
}
}
}
但它在getline
->上中断
Unhandled exception at 0x7730B4D9 (ntdll.dll) in GameCore.exe: 0xC0000005: Access violation writing location 0x00000014.
检查的地方
else
/*
* Not part of _iob[]. Therefore, *pf is a _FILEX and the
* lock field of the struct is an initialized critical
* section.
*/
EnterCriticalSection( &(((_FILEX *)pf)->lock) );
在_file.c
文件中,这里有什么问题?