Re: [SLUG] [PIG] Guess That Function #1

From: Eben King (eben1@tampabay.rr.com)
Date: Mon May 01 2006 - 17:49:09 EDT


On Mon, 1 May 2006, Dylan William Hardison wrote:

> So, guess what this C-language function does:
> int f(void)
> {
> long one = 1;
> return ! ( *((char *)(&one)) );
> }
>
> I'll give you a hint: It either returns 1 or 0, depending on what you
> compile it on.

f()==1 iff TRUE==0, f()==1 iff TRUE==1?

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar
An ASCII character walks into a bar and orders a double. "Having a bad
day?" asks the barman. "Yeah, I have a parity error," replies the ASCII
chrcter. The barman says, "Yeah, I thought you looked a bit off." - Skud

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:31:44 EDT