Char: Difference between revisions
Jump to navigation
Jump to search
Tip:Despite its name, there is no need for char to be used to store character data. It can also be employed simply as a means of storing one byte of data.
mNo edit summary |
TomEdwards (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
'''<code>char</code>''' is the amount of memory needed to store one [[W:ASCII|ASCII]] character. On architectures that Source supports, this is one [[W:byte|byte]] or eight [[W:bit|bit]]s. | |||
<source lang=cpp> | |||
char MyChar = 'T'; // single quote marks | |||
</source> | |||
{{tip|Despite its name, there is no need for char to be used to store character data. It can also be employed simply as a means of storing one byte of data.}} | |||
Arrays of <code>char</code> or <code>[[wchar_t]]</code> are known as [[string]]s, and are used to store text. | |||
== See also == | |||
* [[String]] | |||
* <code>[[wchar_t]]</code> | |||
[[category:Variables]] | |||
[[Category:Glossary]] | |||
[[ |
Revision as of 06:13, 8 December 2010
char
is the amount of memory needed to store one ASCII character. On architectures that Source supports, this is one byte or eight bits.
char MyChar = 'T'; // single quote marks

Arrays of char
or wchar_t
are known as strings, and are used to store text.