Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a program in C++ to concatenate two strings into third
string using pointers

Answer Posted / naman patidar

#include <iostream.h>
#include <string.h>

void main(){
char *str1 = "First String";
char *str2 = "Second String";
int len = strlen(str1)+strlen(str2)+1;
char *result = new char[len];

int i ;
for( i =0 ; i<strlen(str1); i++){
result[i] = str1[i];
}
for(int j=0; j<strlen(str2); j++, i++) {
result[i] = str2[j];
}
result[i] ='\0';
cout<<result;
}

Is This Answer Correct ?    88 Yes 58 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is stl part of c++ standard?

1044


What two types of containers does the stl provide?

952


Define stl.

1226


Explain stl.

1310


What is meant by stl in c++?

1098


Is there any error below, its a code to delete all entires from a map #include #include iostream.h int main() { int i =0; map TestMap; while(i<3) { TesMap.insert(TestMap::value_type(i,Test)); i++; } typedef map :: iterator mapIter =TestMap.begin(); if(mapIter!=TestMap.end()) { TestMap.erase(mapItrer); ++mapIter; } return 0; }

2347


What is the use of stl?

1048


What are the components of stl?

1060


Describe the My Computer and My Documents folders; identify the elements that are present in every Window.

2466


What are the various types of stl containers?

1118


help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase

2327


What does stl stand for in basketball?

1091


please visit this site you'll find my question this is my homework please answer it if you can http://easyscience.org/ib/lofiversion/index.php/t36168.html

2215


What do stl stand for?

1076


How connect plc and pc through software

2422