strcpy function : string.h >> Copy second string into First
strcpy function : string.h :Copy second string into First
What strcmp Actually Does ?
- Function takes two Strings as parameter
- Header File : String.h
- It returns string
- Perpose : Copies String2 into String1
- Original contents of String1 will be lost
- Original contents of String2 will remains as it is ….
Syntax :
char * strcpy ( char *string1, char *string2 ) ;Return Type
Return Type | String |
Parameters | Two Strings |
Live Example 1
char s1[10] = "SAM" ;
char s2[10] = "MIKE" ;
strcpy (s1,s2);
puts (s1) ; // Prints : MIKE
puts (s2) ; // Prints : MIKE