"cout" strings written in Greek

I am new in this site .... I am Greek
I am learning C++.
I would like to ask, how can I "cout" strings written in Greek...
For example :

cout << "Καλημέρα" << endl;
"Καλημέρα": means "Good morning"

Some people advised me to use "wchar_t"

wchar_t *ss = L"Καλημέρα";
cout << ss << endl;

But it outputs only the memory value (I don't know how to say it in english) of the pointer (a 16-base number), but not the string...

Can anyone help me? Thanks in advance ....
use wcout for wchar_t
Friend wcout in QT-CREATOR shows spaces instead of greek characters
In DEVCPP compiler does not even recognise the word "wcout"

About the greek characters any suggestions ??
On some systems that use UTF-8 as default, like Linux, you don't have to do anything special at all. cout << "Καλημέρα" << endl; would print fine.

On Windows you probably have to use wchar_t/wstring/wcout to make it work. A font that can show greek symbols must be used (not sure what's the default). Unfortunately I don't think MinGW supports wcout.
Try this:

1
2
3
4
5
6
7
8
9
10
11
12
#define  UNICODE
#define _UNICODE
#include <windows.h>

int main()
{
    LPCTSTR good_morning = TEXT("Καλημέρα!");

    DWORD written;

    WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), good_morning, 9, &written, 0);
}

Also, see this -> http://www.cplusplus.com/forum/articles/16820/
Last edited on
Thanks everyone for the answers.... I was sure that many people would help me in this site !!!

@ m4ster r0shi

Your "trick" worked in devcpp ... But I don't understand the code you wrote me !
My knowledge in C++ is only what I've read in books that are for beginners (like C++ from ground up - Herbert Schildt) ... I know nothing about unicode stuff ...
This tells me that I have much to learn ....

@ RandomStuff

My friend from tomorrow I WILL study your programs to learn more ......

@ Peter87

As you said I tried in g++-linux, and the greek appeared OK!!
I would like to give me some links to learn more about: "wchar_t/wstring/wcout".
The classical books write nothing about these ...

@ to everone

I would like to give me some links to learn more about: "wchar_t/wstring/wcout"
The problem in qtcreator remains (in devcpp - g++ all things SOLVED)...
Sorry for my english...
THANKS again for your advices !!!!!!
Topic archived. No new replies allowed.