String t: Difference between revisions
Jump to navigation
Jump to search

TomEdwards (talk | contribs) (Created page with ''''<code>string_t</code>''' is a Valve-specific replacement for the W:C String. It doesn't do anything special; it's just an indirection to "allow more flexibility in future…') |
mNo edit summary |
||
| (5 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{lang|String t|$title=string_t}} | |||
'''<code>string_t</code>''' is a Valve-specific replacement for the [[W:C String|C String]]. It doesn't do anything special; it's just an indirection to "allow more flexibility in future ports or optimization". | '''<code>string_t</code>''' is a Valve-specific replacement for the [[W:C String|C String]]. It doesn't do anything special; it's just an indirection to "allow more flexibility in future ports or optimization". | ||
| Line 22: | Line 23: | ||
== See also == | == See also == | ||
* | * [[String]] | ||
* <code>[[char]]</code> | * <code>[[char]]</code> | ||
[[Category:Variables]] | [[Category:Variables]] | ||
Latest revision as of 23:42, 17 November 2022
string_t is a Valve-specific replacement for the C String. It doesn't do anything special; it's just an indirection to "allow more flexibility in future ports or optimization".
Bizarrely, string_t can be one of three things depending on preprocessor set-up:
Usage
Whichever of the above is in effect, there are four macros to use:
NULL_STRING- A constant empty string.
STRING(string_t)- Get a C string. Don't use
ToCStr()directly! MAKE_STRING(const char *)- Make a string_t.
IDENT_STRINGS( s1, s2 )- Are these strings (of either type) pointing to the same memory?