title: Why am I getting this error when i use strcat in c?
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;math.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      int i = 4;
      double d = 4.0;
      char s[] = "HackerRank ";
      int a;
      double b;
      char c[60];
      scanf("%d %lf", &amp;a, &amp;b);
      scanf("%[^\n]", c);
      char r[100];
      strcpy(r, s);
      strcat(r, c);
      a += i;
      b += d;
      printf("%d\n%.1lf\n%s", a, b, r);
      return 0;
  }
  </code></pre>
  
  <p>And the output i get for this code is </p>
  
  <pre class="lang-none prettyprint-override"><code>16
  8.0
  HackerRank �j�&amp;�
  </code></pre>
  
  <p>And the expected output is </p>
  
  <pre class="lang-none prettyprint-override"><code>16
  8.0
  HackerRank is the best place to learn and practice coding!
  </code></pre>
  
  <p>Can someone help me out with the error regarding the strcat part?</p>