passing structures

Sean Fagan seanf at sco.COM
Sun Oct 14 19:34:33 AEST 1990


In article <1990Oct11.162737.11332 at zoo.toronto.edu> henry at zoo.toronto.edu (Henry Spencer) writes:
>In article <241 at motto.UUCP> andrew at motto.UUCP (Andrew Walduck) writes:
>>result = add(a,{5,8});
>>But this isn't supported by ANSII! There's no way to pass a structure
>>as a parameter! It should be do-able, the prototype exists, so the 
>>types can be punned appropriately...any idea why it wasn't? No prior-art?

gcc already does this, although you need a typecast.  So there's your
prior-art.  I, however, have never used it (other than verifying that it
works, just now), and henry's suggestion works just as well.

-- 
-----------------+
Sean Eric Fagan  | "*Never* knock on Death's door:  ring the bell and 
seanf at sco.COM    |   run away!  Death hates that!"
uunet!sco!seanf  |     -- Dr. Mike Stratford (Matt Frewer, "Doctor, Doctor")
(408) 458-1422   | Any opinions expressed are my own, not my employers'.



More information about the Comp.lang.c mailing list