Thread: convert ints to string

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    24

    convert ints to string

    Hi,
    I'd usually look this up in a book, but I loaned my C book to friend so I have to turn here. I need to convert a string to an int, do something to it, and then convert back to a string. I know atoi() converts a string to an int, but I don't know what function gets it back to a string (maybe itoa()??).

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    Yep. You can use itoa ().

  3. #3
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    itoa() is not a standard function so it is not available to everybody. It is easier and standard conforming to use sprintf()
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. String Class
    By BKurosawa in forum C++ Programming
    Replies: 117
    Last Post: 08-09-2007, 01:02 AM
  2. Replies: 4
    Last Post: 03-03-2006, 02:11 AM
  3. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 03:23 PM
  4. ........ed off at functions
    By Klinerr1 in forum C++ Programming
    Replies: 8
    Last Post: 07-29-2002, 09:37 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM