struct ? why

Mike Albaugh albaugh at dms.UUCP
Tue Oct 18 03:36:13 AEST 1988


>From article <e7VX3#2ntZhS=eric at snark.UUCP>, by eric at snark.UUCP (Eric S. Raymond):
> (Apologies to C gurus who find this too elementary. But if there's one guy
> like this reading the list, there are probably others too intimidated by
> the abstruse tone of our usual stuff to post. Let's be nice to novices --
> as they are, so once were we...)
	Yes, lets.
> 
> In article <315 at hrc.uucp>, dan at hrc.UUCP (Dan Troxel VP) writes:
>>Could some of you please give reasons why 'struct'ing variables should be used
>>in 'C' programming? What speed increases are noticed if any? Code size at end
>>of compile smaller or larger? Things like that.

[ tutorial on why one _should_ use structs deleted]

	Maybe dan at hrc has heard someone talking about another practice,
becoming more common lately, of grouping only vaguely related variables
into exactly one instance of a struct. This actually decreases program
clarity, but can be a fairly big win on machines like the 68K, which
have a fast (well, faster) way to access things that are some (small)
offset from a register based pointer. I'm not proud of it, but I have
used such hacks where speed/code size was paramount and I was forbidden
to use Assembly (or the linker wouldn't co-operate any other way). I
repeat that I can't recommend it when you don't need it, but it can
be a big win on "efficiency". I said essentially this in a mail message
which bounced.

| Mike Albaugh (albaugh at dms.UUCP || {...decwrl!turtlevax!}weitek!dms!albaugh)
| Atari Games Corp (Arcade Games, no relation to the makers of the ST)
| 675 Sycamore Dr. Milpitas, CA 95035		voice: (408)434-1709
| The opinions expressed are my own (Boy, are they ever)



More information about the Comp.lang.c mailing list