How to declare (define) string in C++

2 Answers

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

using namespace std;

int main()
{
	string s = "c c++ c# java";

	cout << s << endl;

	return 0;
}

/*
run:

c c++ c# java

*/

 



answered Feb 24, 2017 by avibootz
0 votes
#include <iostream>
#include <string>

using namespace std;

int main()
{
	string s("c c++ c# java python");

	cout << s << endl;

	return 0;
}

/*
run:

c c++ c# java python

*/

 



answered Feb 24, 2017 by avibootz

Related questions

3 answers 248 views
248 views asked Feb 24, 2017 by avibootz
1 answer 147 views
1 answer 118 views
...