home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / c / 13346 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.4 KB

  1. Path: sparky!uunet!sun-barr!olivea!spool.mu.edu!agate!dog.ee.lbl.gov!network.ucsd.edu!mvb.saic.com!unogate!beckman.com!dn66!a_rubin
  2. From: a_rubin@dsg4.dse.beckman.com (Arthur Rubin)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Sets in C
  5. Message-ID: <a_rubin.715993416@dn66>
  6. Date: 8 Sep 92 23:03:36 GMT
  7. References: <14390@goanna.cs.rmit.oz.au>
  8. Lines: 28
  9. Nntp-Posting-Host: dn66.dse.beckman.com
  10.  
  11. In <14390@goanna.cs.rmit.oz.au> s913578@yallara.cs.rmit.OZ.AU (Fantom) writes:
  12.  
  13. >I've been looking at implementing sets in C,
  14. >the method needs to be able to handle sets of more than 32 elements
  15. >so using bit fields won't work
  16.  
  17. >Using arrays, etc would be fine, except that I want to be able to 
  18. >put soemthing into the set for the duration of a function call only
  19.  
  20. >eg
  21.  
  22. >void foo()
  23. >{
  24. >        settype S;
  25. >    bar(set(elt1 elt2 elt3 S));
  26. >}
  27.  
  28. >the set S should be unchanged by the call to bar
  29.  
  30. (For fixed length sets), putting an array in a structure, with the
  31. proper "const" qualifier should handle argument passing properly, however
  32. you define the MemberQ "primative".  Other than that, it's not clear what
  33. you want to do.
  34. --
  35. Arthur L. Rubin: a_rubin@dsg4.dse.beckman.com (work) Beckman Instruments/Brea
  36. 216-5888@mcimail.com 70707.453@compuserve.com arthur@pnet01.cts.com (personal)
  37. My opinions are my own, and do not represent those of my employer.
  38. My interaction with our news system is unstable; please mail anything important.
  39.