0

Hi all,
I have written a programme, but when it prints the results , it doesnt print £ sign

cout <<"Salary is £ "<< salary_without_overtime<<endl;

Instead it prints u="U" with a funny bar on top.

Now im very new to c++ but i do know basics, can someone please tell me how to print the outcome with £ sign.
thanx

3
Contributors
8
Replies
9
Views
9 Years
Discussion Span
Last Post by iamthwee
0

>it doesnt print £ sign
Your text editor is using Unicode, but the console is using extended ASCII. Try this instead:

cout<<"Salary is \x9C "<< salary_without_overtime <<endl;
0

>it doesnt print £ sign
Your text editor is using Unicode, but the console is using extended ASCII. Try this instead:

cout<<"Salary is \x9C "<< salary_without_overtime <<endl;

that code doesnt work.
any more help?

0

>that code doesnt work.
How didn't it work? It probably printed a character, so maybe you should select what actually gets printed and paste it here. "It doesn't work" is about as useless as me telling you that "it works for me".

0

>try (char)156
Try converting 156 to hexadecimal before suggesting the exact same solution next time. :icon_rolleyes:

0

>I don't normally take notice of your posts
That's odd. Usually people take notice. They say "Oh, Narue posted so the problem is solved way better than I could manage. I won't even bother replying now". ;)

0

That's cute you think of yourself that way. I hope your family share the same sentiments, but they probably think you're just mad? Am I right or am I right :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.