#22 Add ToString method to Integer class

None
closed
None
5
2015-06-08
2006-09-25
Anonymous
No

Add a method to the Integer class to convert a number
to a char * string.

Discussion

  • Logged In: YES
    user_id=505683
    Originator: NO

    Probably do not want to convert to a char* because then there is the question of who deletes the memory. Safer to return a std::string, and not as a reference.

     
  • Jeffrey Walton
    Jeffrey Walton
    2015-06-08

    • status: open --> closed
    • assigned_to: Jeffrey Walton
    • Group: -->
     
  • Jeffrey Walton
    Jeffrey Walton
    2015-06-08

    Use a ostringstream to convert from Integer to string.

    Closing.