convert ints to string

This is a discussion on convert ints to string within the C Programming forums, part of the General Programming Boards category; Hi, I'd usually look this up in a book, but I loaned my C book to friend so I have ...

  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,386
    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, 02: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, 10:37 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 07:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21