Friday, March 25, 2011

Convert Integer to String without itoa

This solution is based from here.

#include <iostream>
#include <sstream>
int main() {
  int i = 100;
  std::stringstream ss;
  ss << i;
  fprintf(stderr, ss.str().c_str());
}

No comments:

Post a Comment