home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16854 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.2 KB  |  30 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!pacbell.com!iggy.GW.Vitalink.COM!nocsun.NOC.Vitalink.COM!wetware!ditka!eagercon!eagercon!eager
  3. From: eager@eagercon.com (Michael J. Eager)
  4. Subject: Re: Multiple Parameter Passing (unspecified number)
  5. Message-ID: <1992Nov19.173922.14256@eagercon.com>
  6. Sender: root@eagercon.com (Operator)
  7. Reply-To: eager@eagercon.com
  8. Organization: Eager Consulting
  9. References: <1992Nov17.105837.21867@henson.cc.wwu.edu>
  10. Date: Thu, 19 Nov 1992 17:39:22 GMT
  11. Lines: 17
  12.  
  13. In article 21867@henson.cc.wwu.edu, n8743196@henson.cc.wwu.edu (Jeff Wandling) writes:
  14. >I'm trying to do a similar thing, except my function doesn't know what type
  15. >to expect.  The next "variable argument" could be any simple type.  How
  16. >do I deal with this?  Is there a way to switch on the type of the next
  17. >argument? When using union's for example---
  18.  
  19. The function receiving the value has to know what to expect, or it has to be
  20. told in some fashion.  Values in C do not identify their types.  So you have to 
  21. pass the information in some form, perhaps in a control string like printf,
  22. or in an array with type codes.
  23.  
  24.  
  25. ---
  26. Michael J. Eager        Michael.Eager@eagercon.com
  27. Eager Consulting        (415) 325-8077 
  28. 1960 Park Boulevard, Palo Alto, CA 94306-1141
  29.  
  30.