delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/08/28/00:00:21

From: those who know me have no need of my name <not-a-real-address AT usa DOT net>
Newsgroups: alt.comp.lang.learn.c-c++,comp.lang.c++,comp.os.msdos.djgpp
Subject: Re: char[] & non-Latin letters
Followup-To: alt.comp.lang.learn.c-c++
Date: 28 Aug 2002 03:43:05 GMT
Organization: earthfriends
Message-ID: <umohmcebcrjr94@news.supernews.com>
References: <akdr5h$1hk2er$1 AT ID-79865 DOT news DOT dfncis DOT de> <3D6B432F DOT 4552DB3E AT mail1 DOT stofanet DOT dk>
<akgl7a$1i2cm0$1 AT ID-79865 DOT news DOT dfncis DOT de>
User-Agent: Gnus/5.090008 (Oort Gnus v0.08) XEmacs/21.4 (Informed Management
(RC1), i686-redhat-linux)
MIME-Version: 1.0
X-Complaints-To: newsabuse AT supernews DOT com
Lines: 27
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

[fu-t set]

in alt.comp.lang.learn.c-c++ i read:

>#define TEST_VALUE 65
>
>char c_value = TEST_VALUE;
>wchar_t wc_value = TEST_VALUE;

you presume too much.  you think you know that 65 is a character, but there
is no guarantee that it is, whether you use char or wchar_t -- you have no
idea what that encoding may be used.  use character literals when you mean
to initialize character variables, e.g.,

char c_value = 'A';
wchar_t wc_value = L'A';

>  cout << c_value << endl;
>  cout << wc_value << endl;

wcout << wc_value << endl;

yes it's cumbersome that cout doesn't adapt to wide arguments, but that's
life.

-- 
bringing you boring signatures for 17 years

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019