title: C strcat - warning: passing arg 2 of `strcat' makes pointer from integer without a cast
body: <p>I'm having a problem with the program below.  I'm trying to scan through a string command entered by the user for certain words.  My major issue right now is that when I run the following I get a warning saying that "passing arg 2 of `strcat' makes pointer from integer without a cast". My intent is to loop through the first three characters of the string "s", concatenate them onto a string "firstthree", and later check the value of the string "firstthree".  Any help is appreciated.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;string.h&gt;
  #include &lt;readline/readline.h&gt;
  #include &lt;readline/history.h&gt;
  
  /* Simple example of using gnu readline to get lines of input from a user.
  Needs to be linked with -lreadline -lcurses
  add_history tells the readline library to add the line to it's
  internal histiry, so that using up-arrow (or ^p) will allows the user
  to see/edit previous lines.
  */
  
  int main(int argc, char **argv) {
      char *s;
      while (s=readline("Enter Name: ")) {
              add_history(s); /* adds the line to the readline history buffer */
              printf("Hello %s\n",s);/*output message to the user*/
              char *firstthree;
              int i;
              for(i = 0; i &lt; 3; i++){
                      strcat(firstthree, s[i]);
                      printf("Hello %s\n",firstthree);//checking to see the character added to the end of the string
              }
              printf("Hey %s\n",firstthree);/*prints out the first three characters*/
              free(s); /* clean up! */
              free(firstthree);
      }
      return(0);
  }
  </code></pre>