title: How to create a new char* in standard C
body: <p>I have this code made for C++ (it works):</p>
  
  <pre><code>char* ConcatCharToCharArray(char *Str, char Chr)
  {
      char *StrResult = new char[strlen(Str) + 2]; 
      strcpy(StrResult, Str);
      StrResult[strlen(Str)] = Chr;
      StrResult[strlen(Str) + 1] = '\0';
      return StrResult;
  }
  
  /* Example: String = "Hello worl"
  Char = "d"
  Final string = "Hello world" */
  </code></pre>
  
  <p>The little problem is that I'm making a standard C program in Ubuntu and I need this code.
  And "new" is NOT being recognized as a reserved word and there's even a red mark under it.</p>
  
  <p>I tried: <code>char *StrResult[strlen(Str) + 2]</code>, but it doesn't work because that way only admits constant values. I'm guessing "malloc" would be the standard C solution in here, how could I do this with "malloc" or any other way for that matter? Thank you so much. </p>