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.
printfpointerprintffunction - it's integer of sort.!unary not, meaning returns0if operand true, ,1operand false. sinceprintftrue (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