Community
cancel
Showing results for 
Search instead for 
Did you mean: 
76 Views

what is this

Hello sir

What is this strcat(), strlen(),strcpy()

Tags (1)
0 Kudos
2 Replies
76 Views

strcpy()

This function copies a string from source to destination. The function takes two string variables as arguments: the destination, and the source, then returns the updated destination variable.

strcat()

The strcat() function concatenates two strings. It appends a copy of the source string to the end of the destination string, and then returns the destination string.

 strlen()

I know you have been waiting for this!!! This function calculates the length of the string.

By web designing trainer

0 Kudos
76 Views

Shortly you just need to know;

1. strlen() -  calculates the length of string

2. strcat() -  Appends one string at the end of another

3. strcpy() - Copies a string into another

I am giving you the below example of strcpy(), try it to see the result;

#include <stdio.h>

#include <string.h>

int main()

{

char str1[10]= "awesome";

char str2[10];

char str3[10];

strcpy(str2, str1);

strcpy(str3, "well");

puts(str2);

puts(str3);

return 0;

}

 

Please post your result that i will bring two more example for you on strcat() and strlen().

0 Kudos