Expert
Expert

Reputation: 31

Way to print EURO dollar sign on Linux? c++

I tried:

#define EURO char(128)

cout << EURO ; //only worked on my windows desktop, not linux

Or is there a character similar to the euro sign to display ?

Upvotes: 1

Views: 265

Answers (1)

Slava
Slava

Reputation: 44258

According to this https://www.compart.com/en/unicode/U+20AC following should work if you Linux session configured to use UTF-8

std::cout << "\xe2\x82\xac" << std::endl;

Note it has to be a string literal not a single char as there are 3 bytes in UTF8 encoding for euro.

Upvotes: 2

Related Questions