how to get the '£' to output in c++
- thecoshman
-
thecoshman
- Member since: Jun. 11, 2006
- Offline.
-
- Forum Stats
- Member
- Level 12
- Blank Slate
I am currently at the level of consol apps, though im just making sure i can do the basics good and proper befor i try anything harder.
how can you get the '£' sign to output. if i just go cout << "£"; i get a u with a bit above it. i no that in pascal you need to use a special command for such things like, so the has to be a c++ equivlent.
I have tried searching google, but aparently the pound sign is this '#'. I always thought that a '#' was known as a hash?
any one want to fill me in on this please?
| C++: MAIN || AS: MAIN || PHP: MAIN || JAVA: MAIN |
- 0x41
-
0x41
- Member since: Dec. 30, 2004
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
At 8/29/06 12:44 PM, thecoshman wrote: how can you get the '£' sign to output. if i just go cout << "£"; i get a u with a bit above it. i no that in pascal you need to use a special command for such things like, so the has to be a c++ equivlent.
You need to output it's ASCII code
cout<<(char)156;
- thecoshman
-
thecoshman
- Member since: Jun. 11, 2006
- Offline.
-
- Forum Stats
- Member
- Level 12
- Blank Slate
thank you, do you know where i can get some sort of table that list the common ones of these?
and how come you cant just use some sort of escape thing, like the newline one? that stupid!
| C++: MAIN || AS: MAIN || PHP: MAIN || JAVA: MAIN |
- elbekko
-
elbekko
- Member since: Jul. 23, 2004
- Offline.
-
- Forum Stats
- Member
- Level 16
- Blank Slate
"My software never has bugs. It just develops random features. " - Unknown
[ FluxBB developer | Quickmarks 0.5.1 | Strings & Ints - my blog ]
- NinoGrounds
-
NinoGrounds
- Member since: Nov. 28, 2005
- Offline.
-
- Forum Stats
- Member
- Level 19
- Programmer
At 8/29/06 01:16 PM, elbekko wrote: http://www.lookuptables.com/
It's funny, there is a alias for that domain (or perhaps your link is a alias for this one):
- elbekko
-
elbekko
- Member since: Jul. 23, 2004
- Offline.
-
- Forum Stats
- Member
- Level 16
- Blank Slate
At 8/29/06 01:22 PM, Nino_JoJ wrote:At 8/29/06 01:16 PM, elbekko wrote: http://www.lookuptables.com/It's funny, there is a alias for that domain (or perhaps your link is a alias for this one):
http://asciitable.com/
I know, I usually use asciitable.com, but it redirects me to that page ;)
"My software never has bugs. It just develops random features. " - Unknown
[ FluxBB developer | Quickmarks 0.5.1 | Strings & Ints - my blog ]
- JeremysFilms
-
JeremysFilms
- Member since: Feb. 18, 2005
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
At 8/29/06 01:09 PM, thecoshman wrote: thank you, do you know where i can get some sort of table that list the common ones of these?
and how come you cant just use some sort of escape thing, like the newline one? that stupid!
Because escaping a character isn't the same as outputting a special character. There's no "new line" character so you need to escape the letter n, it's not a shortcut to output something, it's an escape.
- 0x41
-
0x41
- Member since: Dec. 30, 2004
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
At 8/29/06 01:25 PM, JeremysFilms wrote:
Because escaping a character isn't the same as outputting a special character. There's no "new line" character so you need to escape the letter n, it's not a shortcut to output something, it's an escape.
The newline character is defined is 0x0A so you could do
cout<<"This is "<<(char)0x0A<<"broken up into"<<(char)0x0A<<"three lines";
and have it work correcetly.
- CronoMan
-
CronoMan
- Member since: Jul. 19, 2004
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
You should use unicode instead, cout << "\u00A3", or it might differ from locale to locale
"no sound in ass"
- CyberLemming
-
CyberLemming
- Member since: Aug. 9, 2005
- Offline.
-
- Forum Stats
- Member
- Level 05
- Blank Slate
or you could use std::endl .
- thecoshman
-
thecoshman
- Member since: Jun. 11, 2006
- Offline.
-
- Forum Stats
- Member
- Level 12
- Blank Slate
At 8/30/06 07:47 AM, CyberLemming wrote: or you could use std::endl .
hmmm
std::endl
or
\n
i know wich i will be using
| C++: MAIN || AS: MAIN || PHP: MAIN || JAVA: MAIN |
- thecoshman
-
thecoshman
- Member since: Jun. 11, 2006
- Offline.
-
- Forum Stats
- Member
- Level 12
- Blank Slate
with the (char)156, is there a way of putting it into text with out having to go
cout << "a syntax error costs " << (char)156 << "10 to fix!!!!";
if you know what i mean, is that the only way you can putt it in there.
| C++: MAIN || AS: MAIN || PHP: MAIN || JAVA: MAIN |
- 0x41
-
0x41
- Member since: Dec. 30, 2004
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
At 8/30/06 05:08 AM, CronoMan wrote: You should use unicode instead, cout << "\u00A3", or it might differ from locale to locale
That won't work. You need to use WriteConsoleW if you want to write unicode to a console, and even then it's kind of pointless since you lose portability.
At 8/30/06 11:37 AM, thecoshman wrote: with the (char)156, is there a way of putting it into text with out having to go
cout << "a syntax error costs " << (char)156 << "10 to fix!!!!";
if you know what i mean, is that the only way you can putt it in there.
I guess you can do something like this -
#define b (char)156
int main()
{
cout<<"A syntax error costs "<<b<<"10 to fix!!!\n";
return 0;
}
- CyberLemming
-
CyberLemming
- Member since: Aug. 9, 2005
- Offline.
-
- Forum Stats
- Member
- Level 05
- Blank Slate
At 8/30/06 10:01 AM, thecoshman wrote: i know wich i will be using
good for you, now why don't you hurry to your english class? seems like you need it.
- CronoMan
-
CronoMan
- Member since: Jul. 19, 2004
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
Hello? still using (char)156? Use unicode or it will get fucked up on other locales
"no sound in ass"


