Lexical conversion.

John Carter john.carter@tait.co.nz
Mon Oct 14 20:29:00 GMT 2002

What is the fastest way under gcc-3.* to convert from an int to a string?

ie. Equivalent to this yucky bit of code...

string convert( int number)
  char line[80];
  sprintf( line, "%ld", number);
  return string(line);


John Carter                             Phone : (64)(3) 358 6639
Tait Electronics                        Fax   : (64)(3) 359 4632
PO Box 1645 Christchurch                Email : john.carter@tait.co.nz
New Zealand

Good Ideas:
Ruby                 - http://www.ruby-lang-org - The best of perl,python,scheme without the pain.
Valgrind             - http://developer.kde.org/~sewardj/ - memory debugger for x86-GNU/Linux
Free your books      - http://www.bookcrossing.com

More information about the Gcc-help mailing list