Answers for "ascii to string c++"

C++
0

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"
Posted by: Guest on June-29-2021
0

get ascii value of string in C++

int main()
{
 char *s="hello";
 while(*s!='')
  {
  printf("%c --> %dn",*s,*s);
  s++;
  }
 return 0;
}
Posted by: Guest on December-29-2020

Browse Popular Code Answers by Language