Post Page Advertisement [Top]

C-Programming

Why we ues strcat() function in c-programming language?? give suitable example...

Why we ues strcat() function in c-programming language?? give suitable example...

  • strcat function:-this function takes two arguments,of which first is a string variable and second can be a string constant or a variable. it opends the character of the second argument at the end of the first argument..


/* suitable example...*/
/* strcat function .*/
#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
char st1[10],st2[10];
clrscr();
printf("\n enter first string : ",st1);
gets(st1);
printf("\n enter second string : ",st2);
gets(st2);
printf("\n st1 is : %s ",st1);
printf("\n st2 is : %s ",st2);
strcat(st1," ");
strcat(st1,st2);
printf("\n after appending from second string first string is : %s",st1);
getch();
}





DizIT_Operators
Thank-You 

No comments:

Post a Comment

Bottom Ad [Post Page]