title: c print argument list using va_list
body: <p>I have a simple argument list. And I just wanna print it to stdout, but I'm getting wired output before printing "end". Does anyone know where that empty line and unreadable characters come from??</p>
  
  <p>output:</p>
  
  <pre><code>start
  hello
  hello2
  hello3
  hello 4
  
  UH��AWAVAUATE1�S1�H��HH�E�
  end
  
  
  
  void printTest(const char* msg, ...) {
  
      va_list ap;
      int i;
      const char* curMsg=0;
      va_start(ap, msg);
      printf("start\n");
  
      for(curMsg= msg ;  curMsg!=0 ; curMsg = va_arg(ap,  const char*)){
          printf("%s\n", curMsg);
      }
      printf("end\n");
      va_end(ap);
  }
  
  
  
  int main(){
  
      printTest("hello", "hello2", "hello3", "hello 4");
      return 0;
  }
  </code></pre>