Click here to Skip to main content
15,914,387 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: cout for japanese messages Pin
Rajesh R Subramanian17-Jan-09 5:32
professionalRajesh R Subramanian17-Jan-09 5:32 
GeneralRe: cout for japanese messages Pin
CPallini17-Jan-09 6:42
mveCPallini17-Jan-09 6:42 
GeneralRe: cout for japanese messages Pin
Rajesh R Subramanian23-Jan-09 19:03
professionalRajesh R Subramanian23-Jan-09 19:03 
GeneralRe: cout for japanese messages Pin
CPallini24-Jan-09 7:07
mveCPallini24-Jan-09 7:07 
AnswerRe: cout for japanese messages Pin
Nemanja Trifunovic16-Jan-09 5:57
Nemanja Trifunovic16-Jan-09 5:57 
GeneralRe: cout for japanese messages Pin
NET/C++Developer16-Jan-09 17:36
NET/C++Developer16-Jan-09 17:36 
GeneralRe: cout for japanese messages Pin
Rajesh R Subramanian16-Jan-09 19:39
professionalRajesh R Subramanian16-Jan-09 19:39 
AnswerRe: cout for japanese messages [modified] Pin
Loreia17-Jan-09 6:11
Loreia17-Jan-09 6:11 
If you are using std::wstring's, you need std::wcout.
std::cout works *only* with std::strings.

Since there is no _tcout, I like to use _tprintf (and _T macro) when printing Unicode stuff in console.

Take this code for example:

std::wstring test1 = _T("test1");
std::cout << test1.c_str() << endl; // prints junk "0012DE10"
std::wcout << test1.c_str() << endl; // prints "test1"

But to do it "properly", something like this is needed:

std::basic_string<TCHAR> test1 = _T("test1");
_tprintf(_T("Testing string is: %s"), test1.c_str());

I hope that helps.
Best regards,
loreia

modified on Saturday, January 17, 2009 12:55 PM

AnswerRe: cout for japanese messages Pin
NET/C++Developer19-Jan-09 1:27
NET/C++Developer19-Jan-09 1:27 
AnswerRe: cout for japanese messages Pin
Subrat 470826630-Mar-10 0:58
Subrat 470826630-Mar-10 0:58 
Questionencrypt and decrypt Pin
newhivc16-Jan-09 1:15
newhivc16-Jan-09 1:15 
AnswerRe: encrypt and decrypt Pin
Jijo.Raj16-Jan-09 1:20
Jijo.Raj16-Jan-09 1:20 
AnswerRe: encrypt and decrypt Pin
sashoalm16-Jan-09 1:31
sashoalm16-Jan-09 1:31 
GeneralRe: encrypt and decrypt Pin
newhivc16-Jan-09 1:51
newhivc16-Jan-09 1:51 
GeneralRe: encrypt and decrypt Pin
Iain Clarke, Warrior Programmer16-Jan-09 2:06
Iain Clarke, Warrior Programmer16-Jan-09 2:06 
AnswerRe: encrypt and decrypt Pin
Stuart Dootson16-Jan-09 2:22
professionalStuart Dootson16-Jan-09 2:22 
AnswerRe: encrypt and decrypt Pin
Hamid_RT18-Jan-09 22:52
Hamid_RT18-Jan-09 22:52 
Questionarrays & speed Pin
misterMF16-Jan-09 1:03
misterMF16-Jan-09 1:03 
AnswerRe: arrays & speed Pin
Roger Stoltz16-Jan-09 1:17
Roger Stoltz16-Jan-09 1:17 
AnswerRe: arrays & speed Pin
Stuart Dootson16-Jan-09 2:17
professionalStuart Dootson16-Jan-09 2:17 
GeneralRe: arrays & speed Pin
Luc Pattyn16-Jan-09 2:32
sitebuilderLuc Pattyn16-Jan-09 2:32 
AnswerRe: arrays & speed Pin
Joe Woodbury16-Jan-09 21:35
professionalJoe Woodbury16-Jan-09 21:35 
AnswerRe: arrays & speed Pin
misterMF18-Jan-09 22:51
misterMF18-Jan-09 22:51 
QuestionHeap corruption during heavy calculation in 2 threads [modified to include url] Pin
Roger Allen16-Jan-09 0:06
Roger Allen16-Jan-09 0:06 
AnswerRe: Heap corruption during heavy calculation in 2 threads Pin
Code-o-mat16-Jan-09 0:46
Code-o-mat16-Jan-09 0:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.