?
Solved

How do i represent UK Pound sign in ascii

Posted on 2006-04-28
10
Medium Priority
?
3,002 Views
Last Modified: 2008-01-09
How do i represent UK Pound sign in ascii for an visual c++ project?
0
Comment
Question by:Irtza
10 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 264 total points
ID: 16560633
Hi Irtza,

#include <iostream>

using namespace std;

int main ()
{
       cout<<"This is pound symbol"<<(char)156<<"\n\n";

/* For more symbols, run this loop
    for (int i=0;i<256;i++)
    {
        cout<<i <<((char)i)<<"\t";
    }*/
    return 0;
}

Cheers!
Sunnycoder
0
 
LVL 3

Assisted Solution

by:Raj_Kau
Raj_Kau earned 248 total points
ID: 16560647
it is

£      &#163;


you can look this into this

http://www.bbsinc.com/symbol.html


raj
0
 
LVL 6

Assisted Solution

by:saravananvg
saravananvg earned 248 total points
ID: 16560983
Hello sir

    It is Alt + 156 on the number key board.

with regards,
padmaja.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 85

Assisted Solution

by:ozo
ozo earned 248 total points
ID: 16561792
You can't in ASCII but you can in ISO 8859-1
"£"
0
 

Assisted Solution

by:fevster
fevster earned 248 total points
ID: 16561981
You can either use &pound; or &#163;
0
 
LVL 4

Assisted Solution

by:tobydavid
tobydavid earned 248 total points
ID: 16562383
On some systems, the extended ascii number for the British pound is wither 156 or 163.  That might help explain the differences in the previous answers.
0
 
LVL 5

Assisted Solution

by:lostcarpark
lostcarpark earned 248 total points
ID: 16568722
It all depends on which operating system you're using and which version of Visual C++.

If your users are using the ISO8859-1 character set (aslo known as Latin 1), then character 163 decimal (0xA3 hex) will give you the pound symbol. But this will fail if the user switches to an Eastern European or Arabic or Russian or Greek or any of the many other locales.

If you can use Unicode you're much better off. The Unicode value for the pound sign in 0x00A3. This may look the same as the hex Ascii value, but the important difference is that it will always be valid, regardless of the locale.

Here's a good article about using Uniclde in Visual C++ (you need to register to read it but it's free):

http://devcentral.iftech.com/articles/C++/unicode/default.php
0
 

Author Comment

by:Irtza
ID: 16569173
I keep getting a u with a little dash on top of it
0
 
LVL 18

Assisted Solution

by:Jose Parrot
Jose Parrot earned 248 total points
ID: 16575335
Hi Irtza,

Try open the character map.
If you are using Windows XP: Start -> Programs -> Accessories -> System Tools -> Character Map.

The full character set is shown.
Click on the character you want. If you don't find the IK Pound symbol, then the selected character set doesn't support it. For exemple: the Korean set doesn't have it. You should change to Unicode, for instance.

Now that you have the symbol you are looking for in the map, click on it.
Take a look in the character map window bottom letft. The ASCII code is there.
In my computer, it is Unicode 0x00A3.

Now, use the same settings in your c++ program.
Just a curiosity: Do you see a £ here?

Hope it helps,
Jose
0
 

Author Comment

by:Irtza
ID: 16576411
the points were 250 now 500 don't know who to award
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question