Is wchar_t guaranteed to be larger than char?

From: Mark A. Gibbs (x_gibbsmark_at_rogers.com_x)
Date: 03/29/05


Date: Mon, 28 Mar 2005 21:32:47 -0500

Good day,

I'm asking this just out of curiosity, but it just occurred to me to
reread the section on wchar_t (3.9.1.5), and unless I'm reading it
wrong, there is no guarantee that wchar_t is larger than char.

What I'm seeing is that it has to have the same characteristics as its
underlying type, which can be any integral type. The integral types are
bool, char (plain, signed, unsigned), short, int and long (signed and
unsigned, plus presumably long long) (3.9.1.7). So the underyling type
could be signed char?

-- 
Mark A. Gibbs (aka. Indi)
Administrator
#c++ on irc.Rizon.net
http://ca.geocities.com/indij@rogers.com/
(temporary website)


Relevant Pages

  • Re: How to check variables for uniqueness ?
    ... one change to the existing definition of Java: rather than define a char ... as a 16-bit integral type, define it as a non-integral type of an ... There would have to have been small changes to the JVM spec, ...
    (comp.lang.java.programmer)
  • Re: What is the advantage of malloc over calloc
    ... 'char'. ... initialization to produce defined result for all _integral_ types. ... integral type other than 'char'. ... # are zero shall be a representation of the value zero in that type. ...
    (comp.lang.c)
  • Re: How to check variables for uniqueness ?
    ... than define a char as a 16-bit integral type, ... Of even as an unsigned integral type with a size guaranteed to be <= ... There would have to have been small changes to the JVM spec, ... as the character's UTF-8 representation. ...
    (comp.lang.java.programmer)
  • copying char to cepropval.val.lpwstr
    ... the char to an LPWSTR, but that gives me a runtime error when I try to ... tblProceduresHistory is the struct that contains my chars. ... Conversion from integral type to pointer type requires ... C-style cast or function-style cast ...
    (microsoft.public.windowsce.app.development)