Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Injected-Via-Gmane: http://gmane.org/ To: cygwin AT cygwin DOT com From: "Alex Vinokur" Subject: Problem with wchar_t Date: Tue, 22 Apr 2003 21:19:07 +0200 Lines: 60 Message-ID: X-Complaints-To: usenet AT main DOT gmane DOT org X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Cc: gcc-help AT gcc DOT gnu DOT org =================== Windows 2000 CYGWIN_NT-5.0 GNU gcc/++ 2.95.3-5 =================== wchar_t wch1 = 65; Why does 'cout << wch1' print '65' (but not 'A') ? ====== C++ code : BEGIN ====== // File main.cpp #include #include using namespace std; int main () { wchar_t wch1; char ch1; wch1 = 65; ch1 = 65; cout << wch1 << endl; cout << wchar_t (wch1) << endl; cout << ch1 << endl; return 0; } ====== C++ code : END ======== ====== Compiling & Running : BEGIN ====== % g++ main.cpp % a.exe 65 65 A ====== Compiling & Running : END ======== ================================= Alex Vinokur mailto:alexvn AT connect DOT to http://www.simtel.net/pub/oth/19088.html ================================= -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/