title: C compilation error for basic function
body: <p>I'm trying to write my own version of strcat (I call it "append").  Here's what I have:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
  
    char *start = "start";
    char *add = "add";
    append(start, add);
    printf(start);
  
  }
  
  void append(char *start, char *add) {
    //get to end of start word
    char *temp = &amp;start;
    while (*temp != '\0') {
      temp++;
    }
    *temp = *add;
    while (*temp != '\0') {
       *temp = *add; 
    }
  }
  </code></pre>
  
  <p>When I compile, I get 3 warnings and an error:</p>
  
  <blockquote>
    <p>1) warning: implicit declaration of function 'append' is invalid in C99</p>
    
    <p>2) warning: format string is not a string literal (potentially insecure)</p>
    
    <p>3) error: conflicting types for 'append'</p>
  </blockquote>
  
  <p>I don't see how the arguments I pass into my append function within main conflict with the function definition below it.</p>
  
  <blockquote>
    <p>4) warning: incompatible pointer types initializing 'char *' with an expression of type 'char **'; remove &amp;</p>
  </blockquote>
  
  <p>Why would I want to remove <code>&amp;</code> here?  I thought I could declare and initialize my <code>char</code> pointer to the proper memory address all at once.</p>
  
  <p>Any help is much appreciated.</p>