title: Function argument treated as undeclared
body: <p>I've prepared this simple example which is not working for me</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  FILE *fp;
  char filename[] = "damy.txt";
  
  void echo (char[] text)
  {
      fp = fopen(filename, "a");
      fwrite(text, 1, strlen(text), fp);
      fclose(fp);
      printf(text);
  }
  
  int main ()
  {
      echo("foo bar");
      return 0;
  }
  </code></pre>
  
  <p>It's supposed to write both to command window and to file. However, this gives compilation error - the <code>text</code> used in echo() is not declared. Does c need another declaration of the variable?</p>