I'm getting started with c and i have the following question:
Within main()
Output:Code:char string[] = "Hallo World";
function(string);
void function(char *str)
{
printf("%s\n",str);
char *ptr = str + 5;
*ptr = '-';
printf("%s\n",str);
}
Hallo World
Hallo-World
Why does the program doesn't work if i'm defining:
char *string = "Hallo World";