int conversion operator

This is a discussion on int conversion operator within the C Programming forums, part of the General Programming Boards category; Is there a "%?" conversion operator for binary? for example ... scanf("%d",&a); printf("%x",a); will convert a decimal number to a ...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    7

    int conversion operator

    Is there a "%?" conversion operator for binary?
    for example ...

    scanf("%d",&a);
    printf("%x",a);

    will convert a decimal number to a hexadecimal number.I didn't see a way to convert to binary.Am I missing something or do I have to do it the long way?

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,607
    "long way"

    It'll be a good exercise (and won't be too long).

    gg

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    7
    OK,

    Thanks for pointing in the right direction CodePlug

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Drawing Program
    By Max_Payne in forum C++ Programming
    Replies: 21
    Last Post: 12-21-2007, 04:34 PM
  2. Moving Average Question
    By GCNDoug in forum C Programming
    Replies: 4
    Last Post: 04-23-2007, 11:05 PM
  3. Working with random like dice
    By SebastionV3 in forum C++ Programming
    Replies: 10
    Last Post: 05-26-2006, 09:16 PM
  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. How do you search & sort an array?
    By sketchit in forum C Programming
    Replies: 30
    Last Post: 11-03-2001, 04:26 PM

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