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

>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;

>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?

>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".

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

>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". ;)

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 article has been dead for over six months. Start a new discussion instead.