Archived

This topic is now archived and is closed to further replies.

redneckCoder

what's a character?

Recommended Posts

redneckCoder    122
What exactly constitutes a character? I know this may seem like a silly question, but I couldn''t find the answer. Are characters defined as any symbol that can be typed with the keyboard producing a graphical representation on the screen of the key pressed or is it just letters and numbers? Thanks. -AJ C:\DOS C:\DOS\RUN RUN\DOS\RUN -Comic Book Store Guy''s t-shirt that I saw on the Simpsons, although it didn''t actually come from the Simpsons. http://vdsoft.netfirms.com/home.html

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
quote:
Original post by redneckCoder
any symbol that can be typed with the keyboard producing a graphical representation on the screen of the key pressed




I''d say that.. :D

Share this post


Link to post
Share on other sites
Fruny    1658
A character is not necessarily printable (only if isprint() is true), nor graphical (isgraph()), nor just letters and numbers (isalnum()). They also include control characters (iscntrl()), inherited from teletype (including carriage return, tab, line feed, bell, page feed, backspace, null ...)

(The functions can be found in <ctype.h> (C)or <cctype> (C++))

Fundamentally, an ASCII character is a value between 0 and 127 (though they are semi-standardised to 255) that can be interpreted according to the ASCII standard (cf. this page, for exemple)

There are other character conventions (EBCDIC, Unicode...) which can cover single or multibyte characters... all are only conventional interpretations of integral values.


[Questions (STFW) | GDNet Start Here | GDNet Search | Forum FAQ | Google | Asking Smart Questions ]
[Docs (RTFM) | MSDN | SGI''s STL | OpenGL | File formats]
[C++ Must Haves (RTFS) | MinGW | Boost | Loki | FLTK | SDL ]

Stolen from Magmai Kai Holmlor, who held it from Oluseyi, who was inspired by Kylotan...

Share this post


Link to post
Share on other sites