title: How to initialize a wchar_t variable?
body: <p>I am reading the book: <em>C: In a Nutshell</em>, and after reading the section <em>Character Sets</em>, which talks about wide characters, I wrote this program:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stddef.h&gt;
  #include &lt;wchar.h&gt;
  
  int main() {
    wchar_t wc = '\x3b1';
    wprintf(L"%lc\n", wc);
    return 0;
  }
  </code></pre>
  
  <p>I then compiled it using gcc, but gcc gave me this warning:</p>
  
  <blockquote>
    <p>main.c:7:15: warning: hex escape sequence out of range [enabled by default]</p>
  </blockquote>
  
  <p>And the program does not output the character α (whose unicode is U+03B1), which is what I wanted it to do.</p>
  
  <p>How do I change the program to print the character α?</p>