strcat()

strcat()

Description

Concatenate two strings.

Syntax

strcat(dest[], source[]);

Parameters

Variable

Input

Variable

Input

dest[]

The buffer holding the initial string on entry and the resulting string on return.

source[]

The string to append to the string in parameter dest.

Returns

The string length of dest[] after concatenation.

Function call example

String concatenation example
new Destination_array[30]=''start''; new source_array[25]=''this goes after start''; main(){ while(1){ strcat(Destination_array,source_array);// place source array to the end of destination array Delay(1000); } }

Notes and Warnings

During concatenation, the source string may be converted from packed to unpacked, or vice versa, in order to match dest. If dest is an empty string, the function makes a plain copy of source, meaning that the result (in dest) will be a packed string if source is packed too, and unpacked otherwise.

Used in Examples

Accelerometer example