Char: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
{{otherlang2
{{lang|Char}}
|de=Char:de
}}
'''<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.
'''<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.


Line 13: Line 11:


== See also ==
== See also ==
* [[String]]
* [[String]]
* <code>[[wchar_t]]</code>
* <code>[[wchar_t]]</code>
Line 19: Line 16:
[[category:Variables]]
[[category:Variables]]
[[Category:Glossary]]
[[Category:Glossary]]
[[Category:English]]

Revision as of 03:26, 20 May 2021

English (en)Deutsch (de)Русский (ru)Translate (Translate)

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
Tip.pngTip: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 char or wchar_t are known as strings, and are used to store text. char* means a pointer to a char, which is almost always the start of a string.

See also