By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,110 Members | 1,567 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,110 IT Pros & Developers. It's quick & easy.

Mixing Wide & Narrow Character Output to stdout

P: n/a
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;
}
Mar 15 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Andy wrote:
Can I mix wide and narrow character output to stdout?


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:di***********@yahoo.com> <http://www.dietmar-kuehl.de/>
<http://www.eai-systems.com> - Efficient Artificial Intelligence
Mar 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.