Hello world!!
I was trying to make a function that replaces some given string with another given string throughout a give string.
but a strange error showed up. When I tried small pieces of code the error appeared again with on trying to execute the following code:
Code:
void f(char * ptr)
{
*(ptr) = 'a';
}
int main(void)
{
char * strng = "Hello world. The world is just awesome";
puts(strng);
f(strng);
}
error appears when trying to execute *(ptr) = 'a';
error msg:
Code:
Unhandled exception at 0x011c17a1 in replacing string 2.0.exe: 0xC0000005: Access violation writing location 0x011c5d30.
Thanks in advance.