Hex 2 Dec

Discussion in 'Web Design & Coding' started by FishBoy, Nov 28, 2004.

  1. how do you convert a hex number to a decimal in C... i heard you can do something like %x but i dont know how to do it... can anyone help :) thx
     
  2. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    Decimal = %d
    Hex = %X
    Octal = %o

    eg:
    Code:
    int i = 0xFF;
      printf("Decimal: %d\n", i);
      printf("Hex: %X\n", i);
      printf("Octal: %o\n", i);
     
  3. aight thx i'll try that see if it works :)