How to append string to another string in C++

1 Answer

0 votes
#include <iostream>
 
using namespace std;
 
int main() {
    string s1 = "c++"; 
    string s2 = " java"; 

    s1.append(s2);
  
    cout << s1;
}
 
 
 
/*
run:
 
c++ java
 
*/

 



answered Jan 9, 2020 by avibootz

Related questions

1 answer 207 views
2 answers 191 views
1 answer 125 views
1 answer 115 views
1 answer 156 views
1 answer 152 views
4 answers 249 views
...