Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!amdcad!weitek!dms!albaugh From: albaugh@dms.UUCP (Mike Albaugh) Newsgroups: comp.lang.c Subject: Re: struct ? why Message-ID: <554@dms.UUCP> Date: 17 Oct 88 17:36:13 GMT References: Organization: Atari Games Inc., Milpitas, CA Lines: 30 From article , by eric@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@hrc.uucp>, dan@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@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@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)