Friday, July 31, 2009

Why the output of printf("%u",***(&(*(&q)))) is 10?

when i=10 and *p=%26amp;i and **q=%26amp;p and all of them are integer in c programing..

Why the output of printf("%u",***(%26amp;(*(%26amp;q)))) is 10?
Is this some sort of weird homework question? Because if you did that while at work, someone needs to smack you.





Think of it this way: the *s cancel out the %26amp;s, and if you do that, you're left with **q, which = %26amp;p, et cetera.


No comments:

Post a Comment