G
Guest
Dear All,
Here is my code:
void main()
{
char *p="Hello";
*p='M'; //This is where the error occurs
cout<<p<<endl;
}
This code compiles and executes perfectly in Boreland C++. When I run the
same code in VC++ 6.0, however, I get the below error in debugging mode:
Unhandled exception in Test.exe: 0xC0000005: Access Violation
Can someone please provide me a solution to this?
Thanks in advance,
thejasviv
Here is my code:
void main()
{
char *p="Hello";
*p='M'; //This is where the error occurs
cout<<p<<endl;
}
This code compiles and executes perfectly in Boreland C++. When I run the
same code in VC++ 6.0, however, I get the below error in debugging mode:
Unhandled exception in Test.exe: 0xC0000005: Access Violation
Can someone please provide me a solution to this?
Thanks in advance,
thejasviv