home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / c / 16118 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  1023 b 

  1. Path: sparky!uunet!sdrc!thor!scjones
  2. From: scjones@thor.sdrc.com (Larry Jones)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Returned struct
  5. Message-ID: <2225@sdrc.COM>
  6. Date: 6 Nov 92 15:32:00 GMT
  7. References: <1992Nov5.075611.14809@piccolo.cit.cornell.edu>
  8. Sender: news@sdrc.COM
  9. Lines: 18
  10.  
  11. In article <1992Nov5.075611.14809@piccolo.cit.cornell.edu>, sl14@crux3.cit.cornell.edu (Stephen Lee) writes:
  12. > How can one make use of a struct returned by a function?  e.g.
  13. > struct complex complex_add(struct complex a, struct complex b);
  14. > I tried
  15. > struct complex z1, z2, z3;
  16. > z3 = complex_add(z1, z2);
  17.  
  18. That appears to be correct.  Did you actually have a declaration of
  19. complex_add before the call?  If not, the compiler would assume that
  20. it returned an int rather than a struct and would complain about
  21. trying to assign an int to a struct.
  22. ----
  23. Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
  24. larry.jones@sdrc.com  or  ...uunet!sdrc!larry.jones
  25. We don't ATTEND parties, we just CRASH 'em. -- Calvin
  26.