View Single Post
Old 04-09-2013, 06:02 AM   #21
Japo
Autonomous human
 
Japo's Avatar


 
Join Date: Mar 2006
Location: ,
Posts: 4,613
Default

wchar_t is defined even in C89, but you have to include <stdlib.h> or <stddef.h>.

http://en.wikipedia.org/wiki/Wide_character#C.2FC.2B.2B
Quote:
The wide characters are defined using datatype wchar_t, which in the original C90 standard was defined as
"an integral type whose range of values can represent distinct codes for all members of the largest extended character set specified among the supported locales" (ISO 9899:1990 §4.1.5)
I've even tried it in TurboC++ 1.01 for DOS (not the Unicode program above, only one with a wchar_t instead of char, and literals preceded with L. Of course the Unicode part can be platform dependent, but I think nowadays it'll be standard.

Why a teacher would make someone who's starting to program deal with this, is beyond me...
__________________
Life starts every day anew. Prospects not so good...

Last edited by Japo; 04-09-2013 at 06:20 AM.
Japo is offline                         Send a private message to Japo
Reply With Quote