Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more

To make Hello World return string modifiable, can always allocate memory for the string.
Here the code should produce "Xello World." when return string modified.

Code
Diff
  • char* Hi (void)
    {
      char* ans=malloc(13);
      strcpy(ans,"Hello World.");
      return ans;
    }
    
  • 1
    const char* Hi (void)
    
    1+
    char* Hi (void)
    
    22
    {
    
    3
      return("Hello World.");
    
    4
    }
    
    5
    6
    char *oopsHi(void)
    
    7
    {
    
    8
      return ("Hello World.");
    
    3+
      char* ans=malloc(13);
    
    4+
      strcpy(ans,"Hello World.");
    
    5+
      return ans;
    
    99
    }