Uses of Short

Guy Harris guy at sun.uucp
Wed Sep 11 10:40:34 AEST 1985


> `What are the stimuli that would provoke Guy to respond by typing `short'
> at the C compiler?'

How about an array of 10000 counters, each one of which won't ever get over
10000.  Perfect opportunity for "short" on any machine, especially machines
like mine which has 32-bit "int"s.

"short" is also useful for declaring members of a structure which is
defined by some agency other than the coder (like the hardware designer, in
the case of a device register, or like another program).  Then again, if the
data structure is to be exported to other machines, the agency in question
may want to define it using some language other than C, since you have to
specify byte order, padding between/alignment of members, etc., etc..

	Guy Harris



More information about the Comp.lang.c mailing list