int to char array

This is a discussion on int to char array within the C++ Programming forums, part of the General Programming Boards category; I want to convert an integer of unspecified value into a character array in which each digit of the integer ...

  1. #1
    Unregistered
    Guest

    int to char array

    I want to convert an integer of unspecified value into a character array in which each digit of the integer occupies a single place in the array (i.e. (int)5426 -> { '5', '4', '2', '6' }). I want to be able to manipulate these numbers both as integers and as part of a larger character string. Any suggestions?

  2. #2
    Registered User The Dog's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    788
    Lookup the function itoa() declared in <stdlib.h>

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  2. memory leak
    By aruna1 in forum C++ Programming
    Replies: 3
    Last Post: 08-17-2008, 10:28 PM
  3. Replies: 3
    Last Post: 05-13-2007, 08:55 AM
  4. Converted from Dev-C++ 4 to Dev-C++ 5
    By Wraithan in forum C++ Programming
    Replies: 8
    Last Post: 12-03-2005, 06:45 AM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 05:05 PM

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