Inserting a "£" in an output line in C ++

I have the following code:

cout << "String that includes a £ sign";

However, the £ sign is not recognized by the compiler, and an accented u is displayed instead. I can insert one using the following method:

cout << "String that includes a " << char(156) << " sign";

where 156 is the ASCII code of the £ sign. Is there a way to include this ASCII code in a string without separating it like that? For instance:

cout << "String that includes a <some way of iserting the £ sign> sign";
+5
source share
3 answers

£ "ASCII-" - ASCII - 7 (0,127). 8- , £, , £ . , Unicode, .

+12

escape- \x, .

cout << "String that includes a \x9C sign";

, 156, , .

+7

ASCII 127. (8- , 1960- , ASCII). . , , ++, , , .

, 156, £ . 156 WIndows, Alt "0159" . :

 cout << "String that includes a \x9C sign"; 
+3

All Articles