Hex Chars to Binary

This is a discussion on Hex Chars to Binary within the C Programming forums, part of the General Programming Boards category; Alright, i have a problem here. somehow i need to exclusive or the decimal number 111 and the hex number ...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    9

    Hex Chars to Binary

    Alright, i have a problem here. somehow i need to exclusive or the decimal number 111 and the hex number F6E together. Both are stored as char arrays.

    I assume this means converting both values to binary values and then doing the operation, which is really where i am running into trouble. Also once i get the exclusive or value it needs to be converted back to a string of hex chars for use later.

    any help would be appreciated.

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681

  3. #3
    Registered User TactX's Avatar
    Join Date
    Oct 2005
    Location
    Germany.Stuttgart
    Posts
    65
    sscanf() to convert to binary and snprintf() to convert back to a string.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 11
    Last Post: 03-24-2006, 11:26 AM
  2. Hex Chars to Binary (XOR Swap split)
    By fischerandom in forum C Programming
    Replies: 29
    Last Post: 11-26-2005, 07:13 AM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 04:00 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. Is binary HEX?
    By Budgiekarl in forum Tech Board
    Replies: 11
    Last Post: 11-23-2003, 09:02 AM

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