integer to constant char w/o using itoa()

This is a discussion on integer to constant char w/o using itoa() within the C++ Programming forums, part of the General Programming Boards category; Let's say I'm using a compiler that uses only the functions defined by the ANSI/ISO C?C++ standard. Therefore, itoa() function ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    104

    integer to constant char w/o using itoa()

    Let's say I'm using a compiler that uses only the functions defined by the ANSI/ISO C?C++ standard. Therefore, itoa() function is not available to me. How can I convert and integer such as 72086 to a constant character and then count the number of characters (in the case of 72086 five(5) )?

  2. #2
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Wow, just had this question a week ago. Next term, search the board first.
    You'll find several different ways of doing it here.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 04:06 PM
  2. Replies: 16
    Last Post: 10-29-2006, 05:04 AM
  3. comparing fields in a text file
    By darfader in forum C Programming
    Replies: 9
    Last Post: 08-22-2003, 09:21 AM
  4. Passing structures... I can't get it right.
    By j0hnb in forum C Programming
    Replies: 6
    Last Post: 01-26-2003, 11:55 AM
  5. String sorthing, file opening and saving.
    By j0hnb in forum C Programming
    Replies: 9
    Last Post: 01-23-2003, 01:18 AM

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