title: C program to concatenate two pointer strings with functions
body: <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
      
  char concaten(const char *str1,const char *str2);
      
  int main()
      {
          printf(&quot;%s&quot;,concaten(&quot;Code&quot;,&quot;blocks&quot;));
          return 0;
      }
      
  char concaten(const char *str1,const char *str2) {
      int i=0,j=0;
      char *result;
      while(*str1){
          result[i++]=str1[i++];
      }
      while(*str2){
          result[i+j++]=str2[j++];
      }
      return result;
  }
  </code></pre>
  <p>I wrote this function to get two strings and add them to another third string; I don't understand where I am going wrong, as it doesn't print anything.</p>