Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old March 15th, 2006, 11:25 PM
Andy
Guest
 
Posts: n/a
Default Mixing Wide & Narrow Character Output to stdout

Can I mix wide and narrow character output to stdout? I seem to remember
hearing this was not supported before but I can't find any reference to
such a restriction now I actually need to do it! It seems to work on my
Intel compiler but is it portable?

e.g.

#include <iostream>
#include <iomanip>

int main()
{
std::cout << "Narrow ";
std::wcout << L"Wide\n";
return 0;
}



  #2  
Old March 16th, 2006, 12:45 AM
Dietmar Kuehl
Guest
 
Posts: n/a
Default Re: Mixing Wide & Narrow Character Output to stdout

Andy wrote:[color=blue]
> Can I mix wide and narrow character output to stdout?[/color]

I don't think there is a specific restriction in the C++ standard
but there is one in C standard, if I remember correctly. Effectively,
there is a state machine underlying the C stream (and the C++ streams
are generally defined in terms of these) which does not allow directly
mixing narrow and wide characters (see
<http://www.dinkumware.com/manuals/reader.aspx?b=c/&h=lib_file.html>).
--
<mailto:dietmar_kuehl@yahoo.com> <http://www.dietmar-kuehl.de/>
<http://www.eai-systems.com> - Efficient Artificial Intelligence
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,338 network members.