I get Exception thrown at 0x00007FF99C12F4D1 (ucrtbased.dll) 0xC0000005: Access violation reading location 0x0


I have a program I am making using visual studio 2019. When I try to build an run the program I get the exception

Exception thrown at 0x00007FF99C12F4D1 (ucrtbased.dll) in Program.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

My code looks like this:


int main(){

std::ifstream myfile("test.txt",std::ifstream::binary);

return 0;

If it is cause by not giving a existing file adress I would like to know which files I have to specify in the directory. Do I have to start the directory from C:\ or the folder that the program is in or some other file.

asked on Stack Overflow May 19, 2020 by Homie Kitten • edited May 20, 2020 by Jabberwocky

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0