How to evaluate the following c program? -
#include<stdio.h> int main() { int x; x=~!printf; printf("%x",x); }
can 1 explain me process derive output of program.
printf
pointerprintf
function - it's integer of sort.!
unary not, meaning returns0
if operand true, ,1
operand false. sinceprintf
true (non-zero, because function defined), subexpression far0
.~
bitwise complement. flips bits of binary number given. since given0
, return0xffffffff
.- that result stored
x
, printed out in hexadecimal.
on 64-bit machine might instead 0xffffffffffffffff
, though i'm not entirely certain.
Comments
Post a Comment