Menu

How can I get a £ sign to display

emmaw
2008-06-25
2012-09-26
  • emmaw

    emmaw - 2008-06-25

    Hi there, Im a newbie to C programming and am working my way through a great book but cant find a solution to my problem. Everytime I want to display a £ sign within a printf statement, I get a funny u with a dash above it. Can anyone please tell me how to get this to display correctly as a £ sign. Thanks Emma

     
    • BiT

      BiT - 2008-06-25

      I do believe printf("\234") should do the trick.

       
    • emmaw

      emmaw - 2008-06-25

      Yes, it worked!! Thank you so much. That had been driving me mad since I started!

       
    • cpns

      cpns - 2008-06-26

      If you are using a UK keyboard with the £ on the Shift+3 key, then you may not have your locale set correctly. If you want UK settings generally; in Control Panel->Regional and Language Options->Advanced, set language not non-Unicode programs to United Kingdom and in Control Panel->Regional and Language Options->Languages->Details select Default Input Language = United Kingdom.

      The problem is otherwise the £ in GUI fonts does notmap to teh same character code as in Console mode.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.