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:
#include<iostream>
#include<fstream>
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.
User contributions licensed under CC BY-SA 3.0