Re: OT: Requesting C advice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andy Green wrote:
Michael Hennebry wrote:


printf("%d\n",-2);

does not result in

-2

It should.
printf, declared or not, will look for an int and get it.

printf("%u\n", -2);
is more interesting.


That will do exactly the same on big and little-endian machines too, if
the int size is the same.

Yes, of course. I gave a bad example. But, if one uses different sized
print formats from those in the int, it can do what I wrote...

printf("%d\n",(long int)-2);

can print

-1

for example, on a big-endian machine.

Mike
--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux