Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c Subject: Re: ANSI C questions (parameters, structure assignment) Message-ID: <415@taumet.com> Date: 23 Aug 90 18:14:49 GMT References: <1081.26d26274@desire.wright.edu> Organization: Taumetric Corporation, San Diego Lines: 18 demon@desire.wright.edu (Brett) writes: > 1) In standard C, when you pass a structure bigger than four >longwords, is the structure passed as a value parameter, or just a pointer to >the structure (thus making it a var parameter)? The standard only says that the structure passing must behave AS IF it were copied to the called function's parameter. No conforming compiler can generate code which allows you to modify the original structure from within the called function. Compiler implementors have free reign in the details of how this is done. Some compilers pass a pointer to the original struct, and in the called function preamble copy the data to a local space. Since no programmer-written code gets executed before the copying is done, this is allowable. -- Steve Clamage, TauMetric Corp, steve@taumet.com