Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   Simple C++ Question (http://www.programmingforums.org/showthread.php?t=1246)

Ade Nov 22nd, 2004 5:11 PM

Hey guys, a simple question but i can't seem to find the answer on the net.

The question is how can I get the '£' character. Whenever I type it it comes out as a U with a squiggle on it. I think it's probally a special character but I'm not sure how to get the £ out.

thanks in advance
Ade :)

lostcauz Nov 22nd, 2004 6:57 PM

£ is displayed by holding alt then typing 156...alt-156. I reckon this is what you wanted?

Sudhakar Nov 22nd, 2004 8:31 PM

Hey plz clearly state ur problem do u want to print on console or jst want it in ur program.

kurifu Nov 22nd, 2004 10:50 PM

If you are using a console to output the text you need to find a way to translate all your output to the proper codepage which your console is using, this is an indepth process and I am not willing to explain it here.

A better alternative would be to learn to create and compile your code to work with UNICODE based input and output, there are many articles on the interweb about this, actually I once was writing a book on the topic, but lack the time to complete it.

When you look at UNICODE, if you have question about how things are done, feel free to ask and I can probably help you out in a little more detail.

Good luck with your project.

bl00dninja Nov 23rd, 2004 3:04 AM

as far as console output, this works, don't know if that's what you want though...

:

#include <stdio.h>

int main()
{
        printf("%c", 156);
        return 0;
}


note: in C.

:ph34r:

bl00dninja Nov 23rd, 2004 3:10 AM

oh sorry, for C++

:

#include <iostream>
using namespace std;

int main()
{
        cout<<(char) 156;
        return 0;
}

use a typecast to convert a character into it's ASCII integer value

:ph34r:

Ade Nov 23rd, 2004 5:21 AM

That's wicked mate thanks. :)


All times are GMT -5. The time now is 1:55 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC