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.
There are few compilers that store the string literals in RW memory. The program works as expected in such cases.
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.