IsUnsigned() function?

D'Arcy J.M. Cain darcy at druid.uucp
Wed Jul 18 10:13:26 AEST 1990


In article <1990Jul16.214155.5087 at Neon.Stanford.EDU>
jhsu at Neon.Stanford.EDU (Jeffrey H. Hsu) writes:
>	Here is a C question I was asked at a Microsoft interview (no, I didn't
>get the job...).
>	How would you write a space efficient algorithm/function in C that 
>takes in an integer and returns 0 if signed and 1 if unsigned?
>	IsUnsigned(a)
>		int a;
>	{
>	}
How about:
#define IsUnsigned(a) 0

Since your declaration says that a is an int then you are saying it
is always signed.

-- 
D'Arcy J.M. Cain (darcy at druid)     |   Government:
D'Arcy Cain Consulting             |   Organized crime with an attitude
West Hill, Ontario, Canada         |
(416) 281-6094                     |



More information about the Comp.lang.c mailing list