strncat string in c program
(strncat) string function in c program :
The strncat() function in C++ appends the given number of character from one string to the the end of another string.The strncat() function will take these three arguments:
1) Dest
2) Src
3) Count
1) Dest
2) Src
3) Count
This will append the given number of characters from src string to the end of dest string. The terminating character at the end of dest string will be replaced by the first character of src string .
Return value: The strncat() function returns dest, the pointer to the destination string.
Return value: The strncat() function returns dest, the pointer to the destination string.
program code :
#include<stdio.h>
#include<string.h>
int main()
{
char str[100]="atikur ";
char str2[100]="rahman";
strncat(str, str2,3);
printf(" %s ",str);
return 0;
}
output :

No comments