jituTechnology

jituTechnology

A program to merge two given string using pointer.

A program to merge two given string using pointer.

Codes
/*A program to merge two given string using pointer*/
/*Programed by          Jitendra Kr Yadav
                        10116
                        2Apr,2011*/
#include<string.h>
#include<stdio.h>
#include<conio.h>
void merge(char*,char*);
main()
{
char str_1[20],str_2[20];
printf("Enter the first string: ");
gets(str_1);
printf("Enter the second string: ");
gets(str_2);
merge(&str_1[0],&str_2[0]);
printf("The merged string is: %s.",str_1);
getch();
}
void merge(char*word_1,char*word_2)
{
strcat(word_1,word_2);
}

 

Output
Enter the first string: Surya
Enter the second string: Prakash
The merged string is:SuryaPrakash.
Press any key to continue…
Add a comment

Comments (2)

  1. cheap polo shirtsMarch 24, 2012 Reply
    This publish might be somewhat of the revelation to me.
  2. PraveenJune 5, 2012 Reply
    Programming Great
    Just Awesome I was searching day and night for this code. Thanks to you I finally found it. I wanna thank you a lot for this wonderful post and hope that you will keep on uploading and posting same things like in future Your Fan

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

February 2024
S M T W T F S
 123
45678910
11121314151617
18192021222324
2526272829