However, variables cannot be initialized in their declaration for historical reasons, and trying to do so would define a constant.
Whenever a variable declaration could be interpreted as something else by the compiler, the _var_ keyword helps disambiguating. For example,
However, variables cannot be initialized in their declaration for historical reasons, and trying to do so would define a constant.
Whenever a variable declaration could be interpreted as something else by the compiler, the _var_ keyword helps disambiguating. For example,
* *ftos* and *vtos* convert _floats_ and _vectors_ to strings. Their inverses are, of course, _stof_ and _stov_, which parse a _string_ into a _float_ or a _vector_.
* *strcat* concatenates 2 to 8 strings together, as in:
* *ftos* and *vtos* convert _floats_ and _vectors_ to strings. Their inverses are, of course, _stof_ and _stov_, which parse a _string_ into a _float_ or a _vector_.
* *strcat* concatenates 2 to 8 strings together, as in:
* *strstrofs(haystack, needle, offset)* searches for an occurrence of one string in another, as in:
* *strstrofs(haystack, needle, offset)* searches for an occurrence of one string in another, as in:
-</pre>The offset defines from which starting position to search, and the return value is _-1_ if no match is found. The offset returned is _0_-based, and to search in the whole string, a start offset of _0_ would be used.
+</code></pre>
+
+The offset defines from which starting position to search, and the return value is _-1_ if no match is found. The offset returned is _0_-based, and to search in the whole string, a start offset of _0_ would be used.
* *substring(string, startpos, length)* returns part of a string. The offset is _0_-based here, too.
* *substring(string, startpos, length)* returns part of a string. The offset is _0_-based here, too.
* *Allocated strings* are strings that are explicitly allocated. They are returned by _strzone_ and persist until they are freed (using _strunzone_). Note that _strzone_ does not change the string given as a parameter, but returns the newly allocated string and keeps the passed temporary string the same way! That means:
** To allocate a string, do for example:
* *Allocated strings* are strings that are explicitly allocated. They are returned by _strzone_ and persist until they are freed (using _strunzone_). Note that _strzone_ does not change the string given as a parameter, but returns the newly allocated string and keeps the passed temporary string the same way! That means:
** To allocate a string, do for example:
* *Engine-owned strings*, such as _netname_. These should be treated just like temporary strings: if you want to keep them in your own variables, _strzone_ them.
* *Engine-owned strings*, such as _netname_. These should be treated just like temporary strings: if you want to keep them in your own variables, _strzone_ them.