Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ihnp4!inuxc!pur-ee!uiucdcs!uxc.cso.uiuc.edu!ccvaxa!aglew From: aglew@ccvaxa.UUCP Newsgroups: comp.lang.c Subject: Re: Why pass structs? (not struct p Message-ID: <28700009@ccvaxa> Date: Wed, 11-Mar-87 22:48:00 EST Article-I.D.: ccvaxa.28700009 Posted: Wed Mar 11 22:48:00 1987 Date-Received: Fri, 13-Mar-87 21:57:03 EST References: <1437@kontron.UUCP> Lines: 22 Nf-ID: #R:kontron.UUCP:1437:ccvaxa:28700009:000:730 Nf-From: ccvaxa.UUCP!aglew Mar 11 21:48:00 1987 ...> Why pass structs by value? I occasionally feel uncomfortable passing structs by value, and receiving them as the return value of the function. Frequently because the struct starts offsmall, 16 - 32 bits (eg. struct RectCoord { short x, y; }), so I say "I should use pass by value here because they structure is no bigger than an int". But then I start adding stuff to the struct, more fields, reference counts... The only things that I don't feel guilty about are typedef struct Complex { float re, im; } Complex; and typedef LongLong { unsigned hi, low; } LongLong; the latter because the machine I work on has 64 bit integer instructions, though the C compiler doesn't give you access to them.