How do i represent UK Pound sign in ascii

Posted on 2006-04-28
Last Modified: 2008-01-09
How do i represent UK Pound sign in ascii for an visual c++ project?
Question by:Irtza
    LVL 45

    Accepted Solution

    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;

    LVL 3

    Assisted Solution

    it is

    £      &#163;

    you can look this into this

    LVL 6

    Assisted Solution

    Hello sir

        It is Alt + 156 on the number key board.

    with regards,
    LVL 84

    Assisted Solution

    You can't in ASCII but you can in ISO 8859-1

    Assisted Solution

    You can either use &pound; or &#163;
    LVL 4

    Assisted Solution

    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.
    LVL 5

    Assisted Solution

    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):

    Author Comment

    I keep getting a u with a little dash on top of it
    LVL 18

    Assisted Solution

    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,

    Author Comment

    the points were 250 now 500 don't know who to award

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    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 …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now