online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdio.h> /* This function will print the values in hex format */ void conversion(long long int num) { unsigned int a, b; printf("input: %016llx\n", (long long int) num); a = ((unsigned int *) &num)[0]; b = ((unsigned int *) &num)[1]; printf("unpacked: %08x %08x\n", b, a); ((unsigned int *) &num)[0] = a; ((unsigned int *) &num)[1] = b; printf("repacked: %016llx\n\n", (long long int) num); } int main() { unsigned int num = 5; long long int masked = 0; unsigned int unmasked = 0; /* Packing */ masked = ((long long int)num) << 32; printf("Masked to long long int %lld\n", masked); /* Unpacking */ unmasked = (masked & 0xFFFFFFFF00000000) >> 32; printf("UnMasked to long long int %d\n", unmasked); conversion(masked); return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue