Hex Values in C

Sharky Forums


Results 1 to 2 of 2

Thread: Hex Values in C

  1. #1
    Expensive Sushi
    Join Date
    Jun 2004
    Posts
    9

    Hex Values in C

    does anyone know how to use hex values for ints in C? i have some int values that i need to print as hex characters, how might i do this? thanks for any help.

  2. #2
    Hammerhead Shark EverlastingGod's Avatar
    Join Date
    Feb 2003
    Location
    MD
    Posts
    1,364
    int i = 0xABCDEF01;

    printf("%x", i);
    Stay cool
    and be somebody's fool this year

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •