title: how to run my own C program that prints to std out?
body: <p>I only used C 2-3 times. Following hello world tutorial did not help. the function should just print to std out console.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void my_putstr(char* param_1) {
      char *t ;
  
      for (t = param_1; *t != '\0'; t++) {
          printf("%s", t);
      }
  
  }
  
  int main(){
      my_putstr("abc");
      return 0;
  }
  </code></pre>
  
  <p>How to run this program? I do have main to call &amp; test my putstr function.</p>
  
  <p>I do this:</p>
  
  <pre><code>gcc file.c -o file
  gcc file
  </code></pre>
  
  <p>But it still gives me the error of "main":</p>
  
  <pre><code>(.text+0x20): undefined reference to `main'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>I do have the main function. What's wrong?</p>