title: Why strcat doesn't work with pointer in C?
body: <p>When I execute this with a normal array it's working but with a pointer it doesn't.</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  int main()
  {
      char source[]=&quot;Agdhefhe&quot;;
      char *accum = &quot;&quot;;
      for(int i=0;i&lt;=sizeof(*source)/sizeof(char);i++)
          {
              for(int j=0; j&lt;i; j++)
              strcat(accum,source);
          }
          
      printf(&quot;%s&quot;,accum);
      return 0;
  }
  </code></pre>