This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/8104: cann't use wcout and wprintf to print wchat_t* in gcc-3.2 and gcc-3.1
- From: dragzhb at 163 dot net
- To: gcc-gnats at gcc dot gnu dot org
- Date: 1 Oct 2002 04:37:52 -0000
- Subject: libstdc++/8104: cann't use wcout and wprintf to print wchat_t* in gcc-3.2 and gcc-3.1
- Reply-to: dragzhb at 163 dot net
>Number: 8104
>Category: libstdc++
>Synopsis: cann't use wcout and wprintf to print wchat_t* in gcc-3.2 and gcc-3.1
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Sep 30 21:46:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: dragzhb@163.net
>Release: gcc-3.2
>Organization:
>Environment:
linux and cygwin
>Description:
I cann't use wcout and wprintf to print wchat_t string in gcc-3.2 and gcc-3.1,but I can use wcout to print wchar_t* in gcc-3.0.4,that's why?
the following lines are the source code:
#include <iostream>
using namespace std;
//#define _GLIBCPP_USE_WCHAR_T
int main(int argc, char** argv)
{
const wchar_t* src = L"hello 张还宾带分数动";
wcout << "src: " << src << endl;
}
#include <stdio.h>
#include <wchar.h>
//#include <stdarg.h>
int main(int argc, char** argv)
{
const wchar_t* src = L"hello 张还宾带分数动";
wprintf(L"wstring is : %s \n",src);
return 0;
}
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: