title: printf and wprintf in single C code
body: <p>I have a problem when using <code>printf</code> and <code>wprintf</code> functions together in code. If the regular string is printed first, then <code>wprintf</code> doesn't work. If I use <code>wprintf</code> first then <code>printf</code> doesn't work.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;wchar.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;locale.h&gt;
  
  int main() 
  {
      setlocale(LC_ALL,"");
  
      printf("No printing!\n");
      wprintf(L"Printing!\n");
      wprintf(L"Wide char\n");
      printf("ASCII\n");
      return 0;
  }
  </code></pre>
  
  <p>Outputs:</p>
  
  <pre><code>No printing!
  ASCII
  </code></pre>
  
  <p>While</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;wchar.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;locale.h&gt;
  
  int main() 
  {
      setlocale(LC_ALL,"");
  
      wprintf(L"Printing!\n");
      printf("No printing!\n");
      wprintf(L"Wide char\n");
      printf("ASCII\n");
      return 0;
  }
  </code></pre>
  
  <p>outputs:</p>
  
  <pre><code>Printing!
  Wide char
  </code></pre>
  
  <p>I'm using gcc (GCC) 4.6.1 20110819 together with glibc 2.14 on 64bit Linux 3.0.</p>