#include<conio.h>
void stcat(char *str1, char *str2);
void main()
{
char *str1, *str2;
clrscr();
printf(“nnt ENTER THE FIRST STRING…: “);
gets(str1);
printf(“nnt ENTER THE FIRST STRING…: “);
gets(str2);
stcat(str1,str2);
printf(“nt THE CONCATENATED STRING IS…: “);
puts(str1);
getch();
}
void stcat (char *str1, char *str2)
{
int i = 0,len = 0;
while(*(str1+len)!=’′)
len++;
while(*(str2+i)!=’′)
{
*(str1+len) = *(str2+i);
i++;
len++;
}
*(str1+len) = ‘′;
}
Not Satisfied ? Just search & get the result
Related posts:
- C program – Copy the contents of one string to another string using pointer
- C program – To copy the contents of one string to another string
- C Program – To replace a word by another word in a given string
- C program To reverse the given string
- C program – To check whether the given string is palindrome
