Thread: Conversion

  1. #1
    Unregistered
    Guest

    Conversion

    Does anyone know how and if is possible to convert an int to a hexadecimal

  2. #2
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    Yes, it is.

  3. #3
    Unregistered
    Guest
    you can print it out by using %x instead of %d

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    Another way is use the function itoa() in <stdlib.h>.

    Or if you just want to print an int in hexadecimal:

    int i = 255;
    cout << i << " hex:" << hex << i << endl;

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  2. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  3. Header File Question(s)
    By AQWst in forum C++ Programming
    Replies: 10
    Last Post: 12-23-2004, 11:31 PM
  4. Do I have a scanf problem?
    By AQWst in forum C Programming
    Replies: 2
    Last Post: 11-26-2004, 06:18 PM
  5. Creation of Menu problem
    By AQWst in forum C Programming
    Replies: 8
    Last Post: 11-24-2004, 09:44 PM