Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Converting to string c++

- Writing your own conversion function, the simple:
template<class T> string toString(const T& x) {
	ostringstream ss;
	ss << x;
	return ss.str();
}
- Since C++11 you can also use the std::to_string:
 string s = to_string(0x12f3); // after this the string s contains "4851"
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Converting #string
ADD COMMENT
Topic
Name
4+9 =