How to initialize string by another string in C++

1 Answer

0 votes
#include <iostream>
#include <string>

using std::cout;
using std::endl;
using std::string;

int main()
{
	string s1("c++ programming");

	string s2(s1);

	cout << s2 << endl;

	return 0;
}

/*
run:

c++ programming

*/

 



answered May 7, 2018 by avibootz
...