1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C programming hexidecimal

  1. Feb 2, 2015 #1
    1. The problem statement, all variables and given/known data
    this is in my function
    GET_UINT32( X, input, 0 );

    this is a macro
    #define GET_UINT32(n,b,i) \
    { \
    (n) = ( (uint32) (b)[(i) ] << 24 ) \
    | ( (uint32) (b)[(i) + 1] << 16 ) \
    | ( (uint32) (b)[(i) + 2] << 8 ) \
    | ( (uint32) (b)[(i) + 3] ); \
    }

    3435973836=0xcccccccc
    when inputted into the macro, it out puts
    0x4E6F7726 =1315927840.


    Oxcc, Oxcc, Oxcc, Oxcc, Oxcc, Oxcc, Oxcc, Oxcc
    into
    0x4E, 0x6F, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74

    3. The attempt at a solution
    I am not sure how to begin. I am taking a cryptography class
    for fun as a statistics major. I tried understanding it but it just confused me. I want to see how (uint32) (b)[(i) + 1] << 16 ) changes the input
     
    Last edited: Feb 2, 2015
  2. jcsd
  3. Feb 2, 2015 #2

    Mark44

    Staff: Mentor

    Please show us all of your code.
     
  4. Feb 3, 2015 #3

    phinds

    User Avatar
    Gold Member
    2016 Award

    and use the code tags when you do it.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: C programming hexidecimal
  1. Program in C (Replies: 1)

  2. C++ Program (Replies: 17)

Loading...