C strcat

This function is a concatenation string function. strcat() function concatenates the destination string at the end of the source string. This means it connects two strings. Destination String is appended at the end of source String.
Here in below example:

Source String is: src
Destination String is: city

Syntax for strcat():

Example:

Output:

C strncat()

This strncat() function is used when u need to concatenate some portion of one string
at the end of another string. Here we can give a number of characters that have to concatenate.

Syntax for strncat()

Example:

Output:

In the example there are 3 characters from destination string is append to source string.

Ankit Wasankar

Senior Java Developer
Java 11 | Microservices | Reactjs | SQL

Help others by sharing the content!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.