Strcat

From SA-MP Wiki

Revision as of 04:41, 19 June 2012; view current revision
←Older revision | Newer revision→
Jump to: navigation, search


This function concatenates (joins together) two strings into the destination reference.


Parameters:
(dest[],const source[],maxlength=sizeof string)
dest[]The string to store the two concatenated strings in.
const source[]The source string.
maxlength=sizeof destThe maximum length of the destination.


ReturnsThe length of the new destination string.


new string[40] = "Hello";
strcat(string, " World!");
 
// The string is now 'Hello World!'


Related Functions

The following functions may be useful, as they are related to this function in one way or another.

  • Strcmp: Compare two strings to check if they are the same.
  • Strfind: Search for a string in a string.
  • Strtok: Get the next word/parameter in a string.
  • Strdel: Delete part of a string.
  • Strins: Insert text into a string.
  • Strlen: Get the length of the string.
  • Strmid: Extract part of a string into another string.
  • Strpack: Pack a string into a destination.
  • Strval: Convert a string into an integer.
Personal tools