C strcpy()

The strcpy(destination, source) function copies the source string in destination.

snippet
#include
#include   
int main(){  
 char ch[20]={'r', 'o', 'o', 'k', 'i', 'e', 'n', 'e', 'r', 'd', '\0'};  
   char ch2[20];  
   strcpy(ch2,ch);  
   printf("Value of second string is: %s",ch2);  
 return 0;  
}

Output:

Output
Value of second string is: rookienerd
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +