Day 11 : C++ Language | String Concatenation | Part -2

String Concatenation

It is the adding of 2 or more strings, which are connected using + sign.

#include<iostream>
#include<string>
using namespace std;
int main(){
string age = “23”;
string name = “Aiera” ;
string p…


This content originally appeared on DEV Community and was authored by Mehfila A Parkkulthil

String Concatenation

It is the adding of 2 or more strings, which are connected using + sign.


#include<iostream>
#include<string>
using namespace std;
 int main(){
   string age = "23";
   string  name = "Aiera" ;
   string person = name + age;

   cout << person;
   return 0;
}



// output : Aiera23


#include<iostream>
#include<string>
using namespace std;
 int main(){
   string age = "23";
   string  name = "Aiera" ;
   string person = name + " " + age;

   cout << person;
   return 0;
}



// output : Aiera 23

Previous Blogs


This content originally appeared on DEV Community and was authored by Mehfila A Parkkulthil


Print Share Comment Cite Upload Translate Updates
APA

Mehfila A Parkkulthil | Sciencx (2025-11-08T06:46:36+00:00) Day 11 : C++ Language | String Concatenation | Part -2. Retrieved from https://www.scien.cx/2025/11/08/day-11-c-language-string-concatenation-part-2/

MLA
" » Day 11 : C++ Language | String Concatenation | Part -2." Mehfila A Parkkulthil | Sciencx - Saturday November 8, 2025, https://www.scien.cx/2025/11/08/day-11-c-language-string-concatenation-part-2/
HARVARD
Mehfila A Parkkulthil | Sciencx Saturday November 8, 2025 » Day 11 : C++ Language | String Concatenation | Part -2., viewed ,<https://www.scien.cx/2025/11/08/day-11-c-language-string-concatenation-part-2/>
VANCOUVER
Mehfila A Parkkulthil | Sciencx - » Day 11 : C++ Language | String Concatenation | Part -2. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/11/08/day-11-c-language-string-concatenation-part-2/
CHICAGO
" » Day 11 : C++ Language | String Concatenation | Part -2." Mehfila A Parkkulthil | Sciencx - Accessed . https://www.scien.cx/2025/11/08/day-11-c-language-string-concatenation-part-2/
IEEE
" » Day 11 : C++ Language | String Concatenation | Part -2." Mehfila A Parkkulthil | Sciencx [Online]. Available: https://www.scien.cx/2025/11/08/day-11-c-language-string-concatenation-part-2/. [Accessed: ]
rf:citation
» Day 11 : C++ Language | String Concatenation | Part -2 | Mehfila A Parkkulthil | Sciencx | https://www.scien.cx/2025/11/08/day-11-c-language-string-concatenation-part-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.