what will happen?
main
{
char *p="safer";
p[0]='j';
p[1]='j';
puts(p);
}
Live Blog: Live From The Reveal Of Microsoft's Next-Generation Xbox
-
[image: Screen Shot 2013-05-21 at 7.00.07 AM]It’s Xbox day! Almost exactly
8 years after the announcement of the Xbox 360, Microsoft is back with
another o...
4 minutes ago
Depends on the compiler. Many modern compilers store string literals in read-only memory. Any modification will result in access violation exception. We can catch such exceptions using kernel API like installExceptionHandlers() if supported.
ReplyDeleteThere are few compilers that store the string literals in RW memory. The program works as expected in such cases.