Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8720477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:02:58+00:00 2026-06-13T07:02:58+00:00

I am reading the book: C: In a Nutshell , and after reading the

  • 0

I am reading the book: C: In a Nutshell, and after reading the section Character Sets, which talks about wide characters, I wrote this program:

#include <stdio.h>
#include <stddef.h>
#include <wchar.h>

int main() {
  wchar_t wc = '\x3b1';
  wprintf(L"%lc\n", wc);
  return 0;
}

I then compiled it using gcc, but gcc gave me this warning:

main.c:7:15: warning: hex escape sequence out of range [enabled by default]

And the program does not output the character α (whose unicode is U+03B1), which is what I wanted it to do.

How do I change the program to print the character α?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:03:00+00:00Added an answer on June 13, 2026 at 7:03 am

    This works for me

    #include <stdio.h>
    #include <stddef.h>
    #include <wchar.h>
    #include <locale.h>
    
    int main(void) {
      wchar_t wc = L'\x3b1';
    
      setlocale(LC_ALL, "en_US.UTF-8");
      wprintf(L"%lc\n", wc);
      return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently, I was reading book about Erlang which has hot deployment feature. The deployment
I am reading a book in which author used a code like this public
I'm currently reading the book C# 4.0 in a Nutshell , which by the
I am reading a book which mentions this If the compiler knows every use
After reading a book on LINQ I'm thinking about re-writing a mapper class that
So I'm reading this book on an introduction to cryptography, there's this exercise about
While reading a book about JavaScript I stumbled across an example: var names =
i have came across the sentence in a nutshell while reading a technical book
Reading a book about C# I noticed that sometimes is mentioned value type and
I am currently reading a book on Javascript by Pragmatic, and I'm confused about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.