C strcat()

The strcat(first_string, second_string) function concatenates two strings and result is returned to first_string.

snippet
#include
#include   
int main(){  
  char ch[10]={'h', 'e', 'l', 'l', 'o', '\0'};  
   char ch2[10]={'c', '\0'};  
   strcat(ch,ch2);  
   printf("Value of first string is: %s",ch);  
 return 0;  
}

Output:

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