Last night I got so fustrated trying to do something really simple in c++. I needed to represent a GBP £ sign in a c++ windows console application. My smug friend using linux terminal and GCC assured me that the pound sign did not keep him up last night, but for me compiling away on MSBUILD it was a nightmare. Something so simple. yet after trying EVERY POSSIBLE mixture of search terms, google provided me with nothing! For once google had failed me! It did however suggest escape character methods and all sorts of other fruitfull options but none that worked. When outputing a £ to the command line I got “u”. Not much use when your trying to represent a price in GBP! It turns out that microsoft, being american, does not naturally support the character and the following is required to achieve such a simple thing.
//show pound sign in c++
char pound=156;
cout << “This will cost ” <<pound << “5.00″ ;
Why am I blogging this?? In the hope that after this blog post gets indexed by google, the many others who appear on forums searching for this solution, and those who will come across it in the future, will find this and get an early night! Unlike myself












Omg, I love you so much. I went to the extent of scouring through the character map to see if I was being retarded. Out of interest how did you work it out in the end?
Oh and is this ANSI C compliant?
Honestly I just thought of all the ways I could possibly put this damn pound sign into my app! Then I remebered back to a lecture where I first saw odd data type assignments like char foo=23, then realised I needed the right character code for a pound sign, and yes I assume this is ANSI compliant. I got to my tutorial the following morning and realised my tutor had emailed this solution to the rest of the class, if only I had checked my email!
You sir, are a true master among men, i’ve been looking for this solution for hours now and if it was not for your blog, Google would have failed me too.
Thank you so much
omg thank you so much will help with my school work so much.
doing wage slip’s without a pound sign. she would rip my head off thanks
Well, i wanted this for a quick program and found it after one search on Google, thankyou
Thank you so so much! Google almost failed me and my mind couldn’t cope with that :p.
Thanks so much! I’ve just spent the past hour trying to figure this one out! Got straight to this once I realised it was a cout problem (I’ve been working with char to string conversion, though it was that). Thanks again!
You are an absolute number one, I’ve never been able to figure this out and had to change a program I wrote to use dollar signs. Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you!!!!!!!!!!