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 208 views
2 answers 193 views
1 answer 127 views
1 answer 119 views
1 answer 163 views
1 answer 155 views
4 answers 255 views
...