hi,
can any one explain whats use of ~?
( for example a=5; s=~a;
if i print the value of s it becomes -6 why its happen like this?)
hi,
can any one explain whats use of ~?
( for example a=5; s=~a;
if i print the value of s it becomes -6 why its happen like this?)
The bitwise operator of negation
Convert 5 in binary. Switch every bit. What number comes out?
Code - functions and small libraries I use
It’s 2014 and I still use printf() for debugging.
"Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson
thanQ friend.
iam using integer data type. that's why i got -6.
Last edited by vigneshmr; 03-03-2013 at 03:23 PM.
You figured it out yourself. Nice! But, why don't you explain so that other people can be helped too?
Well, I think it would be ok, if I did give the explanation here.
PS - Welcome to the forum
Last edited by std10093; 03-03-2013 at 03:33 PM.
Code - functions and small libraries I use
It’s 2014 and I still use printf() for debugging.
"Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson