I use this code to read a file and print it out to console:
//includes
int main(){
std::ifstream myReadFile;
myReadFile.open("C:\\Users\\Me\\Desktop\\Win32w\\gdip.ahk");
char output[100];
if (myReadFile.is_open()) {
while (!myReadFile.eof()) {
myReadFile >> output;
std::cout << output;
}
}
myReadFile.close();
}
but after printing out all the contents of the file I get the following error:
Unhandled exception at 0x51F0742A (msvcp120d.dll) in fourteen.exe: 0xC0000005: Access violation reading location 0x002C10AB.
When I run a smaller file(script.ahk) with 5 lines it runs OK. The file gdip.ahk has bout 3300 lines.