Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Converting code from C to PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 106
    Answer it

    Hi! I have a question about a small piece of code in C to make the same piece of code work in PHP, it has to do with a bit shift and I can't figure out what's wrong.

    C:
    unsigned u = 3910796769;
    u += u << 8;
    printf("%u\n",u); 
    //Result : 52422369

    PHP:
    $u = 3910796769;
    $u += $u << 8;
    printf("%u\n",$u);
    //Result : 1005074769633

 0 Answer(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: