Search Your Topic

config
Thursday, 22 June 2017 03:13

C String Concatenation: strcat()

Written by
Rate this item
(0 votes)

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

 
  1. #include <stdio.h>  
  2. void main()  
  3. {  
  4.    char ch[10]={'h''e''l''l''o''\0'};  
  5.    char ch2[10]={'c''\0'};  
  6.    strcat(ch,ch2);  
  7.    printf("Value of first string is: %s",ch);  
  8. }  

Output:

Value of first string is: helloc
Read 264 times
Anish Sir

"I am delighted once again to pen the welcome note to the Tosh!Yas Technologies ."

 Call +91 74 88 34 7779  | Email : anishsingh@live.com

toshiyas.in

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.