On Thursday 22 March 2012 21:56, in comp.lang.c,

http://www.velocityreviews.com/forums/(E-Mail Removed)d wrote:

> What would a function prototype look like that takes one parameter but

> several options can be OR'd together in that parameter? For example:

>

> function(LEFT|RIGHT);

>

> What would the parameter source code look like?
Well, Bill, that depends....

What sort of argument does function() take?

If you are writing function(), then you should know what sort of input you

want it to take. OTOH, if function() has already been written, you can just

look at it to determine the argument type.

Given the little information that you've provided, we can eliminate some

values. Because you already know that the argument will be the result of

several values "Inclusively OR"ed together, you know that the argument must

be an integer type (1999-9899 6.5.12 "Bitwise Inclusive OR operator" - each

operand must be of integer type, and the usual arethmetic conversions will

be performed).

This means that the argument can't be a floatingpoint value (float, long

float, double, long double, long long float), a pointer, a structure or a

union. And that leaves char, unsigned char, short int, unsigned short int,

int, unsigned int, long int, unsigned long int, long long int or unsigned

long long int.

Now, tell us, which one of those is it?

--

Lew Pitcher