Thread: how to add two hexadecimal

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    11

    how to add two hexadecimal

    Hi all, sorry if i sounded like a completely C-programming idiot...

    jus like to know how do i add two hexadecimal...

    say for example (EA02 AND 1201)

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Code:
    sum = 0xea02 + 0x1201;

  3. #3
    Nub SWE
    Join Date
    Mar 2008
    Location
    Dallas, TX
    Posts
    133
    Code:
    double a = 0xEA02;
    double b = 0x1201;
    double c;
    
    c = a + b;
    Or am I oversimplifying?

  4. #4
    Registered User
    Join Date
    Mar 2008
    Posts
    11
    thanks tabstop!!! =)

  5. #5
    Registered User
    Join Date
    Mar 2008
    Posts
    11
    JDGATX...i think that is fine..cos i roughly get the idea of it! thanks so much

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by JDGATX View Post
    Code:
    double a = 0xEA02;
    double b = 0x1201;
    double c;
    
    c = a + b;
    Or am I oversimplifying?
    Those numbers don't need "double", do they now?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 12-02-2007, 05:55 AM
  2. would you explain to me? hexadecimal to decimal
    By shteo83 in forum C Programming
    Replies: 2
    Last Post: 02-25-2006, 03:55 PM
  3. I Can Add!
    By digdug4life in forum C++ Programming
    Replies: 9
    Last Post: 02-07-2005, 03:36 PM
  4. Add a dialog box to a tab
    By axr0284 in forum Windows Programming
    Replies: 0
    Last Post: 01-10-2005, 08:38 AM
  5. Add user without interacting.
    By zahid in forum Linux Programming
    Replies: 3
    Last Post: 12-21-2002, 11:36 PM