Results 1 to 12 of 12

Thread: £

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    10

    £

    Bit of a lame question, but here goes anyway:

    How do i display a £ sign on screen in c++. The below line displays it as a ù. I've tryed it on 2 different computers and 2 different compilers and i have checked that all the regonal options are fine.

    cout<<"The total wages are £"<<Wages;


    Thanks for any assistance

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Uh. Works for me. What OS / terminals did you try? Worked in GNU/Linux with GCC for me, under xvt.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    10
    I'm not a linux person, so i don't know what terminals, GNU, GCC or xvt is but these r the systems and compilers i have tryed:

    I first tryed it on 2000 professional running MS VC++ 6 (profesional i think). I then tryed it on XP prof running MSVC++ 6 enterprise, and finally on a different xp professional under Dev C++ 4. All with the same error.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Linux - an OS kernel.
    GNU - GNU's Not Unix. A free unix clone.

    GNU/Linux - the GNU system with the Linux kernel. What most people know as "Linux".

    GCC - GNU Compiler Collection

    xvt - an X-Windows terminal program


    I know it worked on Windows 2000 for me before with VC++ 7 (and all the proper British region settings, etc.).

    Bizarre :-/
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    Dumb question - the font you are using ACTUALLY has the 'pound' character?

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    10
    dunno, its just a console app, i dont know how to set the font, atm i think it ariel.

  7. #7
    Fanatic Member twanvl's Avatar
    Join Date
    Dec 2001
    Posts
    771
    Under Windows the fond used in console applications depends on the size of the window. You could try resizing it...

    ... ASCII 165 seems to be the pound sign at any size ...

  8. #8
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    For Fixedsys, the character code for the pound is 0xA3, might want to try just that...

    ::shrug::

    Z.

  9. #9
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423
    When i run the code: cout<< "£"; i get a "u" with an accent. I don't think '£' is a dos character.

  10. #10
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Try:
    Code:
    cout << char(0xa3) << endl;
    Z.

  11. #11

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    10
    I tryed changing the font for the window, and there are only 2, both of which give the same result. I also tryed typing in a £ in one of the input screens and it worked (showed on screen as a £).



    Try:

    code:--------------------------------------------------------------------------------
    cout << char(0xa3) << endl;
    --------------------------------------------------------------------------------


    Z.
    Tryed that too, still a ù.

    Nevermind, its a smal problem, and at least i finally know what all those linux accronims mean

  12. #12
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Actually the only thing realted to Linux is Linux itself, which is not really an acronym but a combination of Linus and Unix (Linus Torvald's Unix).
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width