|
-
Nov 1st, 2002, 09:52 AM
#1
Thread Starter
Addicted Member
converting ASCII code to character
how do you convert ascii character code to a character, say like in a cout statement.
-
Nov 1st, 2002, 10:39 AM
#2
Fanatic Member
cast it to a char
(char)<ascii code>
Of course this works only for 0-255 (or actually since it's signed it should be -128 to 127)
-
Nov 1st, 2002, 10:40 AM
#3
Monday Morning Lunatic
char should usually be an unsigned quantity, since a negative character code doesn't mean anything.
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
-
Nov 4th, 2002, 12:21 PM
#4
But it isn't always.
What do you mean by "converting an ASCII code to a character"? The computer makes no distinction between an ASCII code and the appropriate character. It's all about how you output it.
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|