What is strncat() function in C language ?

strncat( ) function in C is basically used to join to string together on the basis of n parameters.

What is strncat() function in C language ?
strncat() in C

Through this article we are going to discuss strncat( ) function in detail in which we will cover following topics.

Topics:-

  1. strncat( ) function in c
  2. strncat( ) function in c example
  3. strncat( ) function in c syntax
  4. header file for strncat( ) function in c

strncat( ) function in C

strncat( ) function is also known as a built in function or standard library function of C but it is widely know as string function, it is another type of concatenation function in string which takes three variables(parameters) strncat(s1, s2, n) and add the left most n character of s2 to the end of s1.

Header file of strncat( ) function in C

strncat( ) function is a built in function of C and it is define in <string.h> header file.

Syntax of strncat( ) function in C

strncat(str1, str2, n);

Example of strncat( ) function in C

#include<stdio.h>
#include<string.h>
int main()
{
  char str[15]="Acein";
  char str1[15]="Study";
  strncat(str,str1,6);
  printf("%s",str);
  return 0;
}
____________________________________

Example of strncat( ) function in C

____________________________________

Conclusion

Strncat( ) function join to string together by using n parameters.


Post a Comment (0)
Previous Post Next Post