I sometime get the following exception
Exception thrown at 0x00007FF9407FC231 (ucrtbased.dll) in Learn.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFEE87BF30. occurred
when I compile the following program in Visual Studio 2017 in x64:
#include <iostream>
using namespace std;
int main()
{
char* c1 = (char*)"hello";
cout << c1; //exception
cin.ignore(1);
}
No problem when compile in x86. Sometimes no exception when I compile firstly in x86 and then in x64.
Is there any illegal code in the program or is it a compiler misbehavior?
User contributions licensed under CC BY-SA 3.0