home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!newsstand.cit.cornell.edu!piccolo.cit.cornell.edu!crux3!sl14
- From: sl14@crux3.cit.cornell.edu (Stephen Lee)
- Subject: Returned struct
- Message-ID: <1992Nov5.075611.14809@piccolo.cit.cornell.edu>
- Sender: news@piccolo.cit.cornell.edu (USENET News System)
- Nntp-Posting-Host: crux3.cit.cornell.edu
- Organization: Fantasy Zone Ithaca, Inc.
- Date: Thu, 5 Nov 92 07:56:11 GMT
- Lines: 20
-
- How can one make use of a struct returned by a function? e.g.
-
- struct complex complex_add(struct complex a, struct complex b);
-
- I tried
-
- struct complex z1, z2, z3;
-
- z1.x = 0; z1.y = 3;
- z2.x = 5; z2.y = 4;
-
- z3 = complex_add(z1, z2);
-
- But BC++ 2.0 complained 'illegal structure operation' on the above.
- Note: I'm using C, not C++.
-
- Please help me.. AdTHANKSvance,
- --
- Stephen Lee
- Internet: sl14@crux2.cit.cornell.edu
-