integer to string

Is there any way to convert int to string? (char arrays, I don't like std::string)
C++ std::stringstream
C sprintf()
In c:
1
2
3
4
5
 
  char temp[20];
  sprintf (temp, "%d", n);
  // or 
  itoa (n, temp,10);  // non standard, but many compilers support itoa 


In C++, you should get used to using std::string.
1
2
3
4
  stringstream ss; 
  string            str;
  ss << n;
  str = ss.str();

WHy wouldn't you like std::string?

but sure:
http://www.cplusplus.com/reference/cstdlib/itoa/
matter of opinion,

Thanks :)
Topic archived. No new replies allowed.