home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19311 < prev    next >
Encoding:
Text File  |  1993-01-06  |  702 b   |  31 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!spool.mu.edu!agate!dog.ee.lbl.gov!news!vela!pd-dom!agrafiot
  3. From: agrafiot@wl.com (Dimitris Agrafiotis)
  4. Subject: question on casting unions
  5. Message-ID: <1993Jan6.160258.25389@wl.com>
  6. Sender: agrafiot@wl.com (Dimitris Agrafiotis)
  7. Organization: Warner Lambert / Parke-Davis
  8. Distribution: usa
  9. Date: Wed, 6 Jan 1993 16:02:58 GMT
  10. Lines: 19
  11.  
  12.  
  13. I have the following question regarding unions. Assume that 'un' is defined
  14. as follows:
  15.  
  16. union
  17. {
  18.    char a;
  19.    long b;
  20. }
  21. un;
  22.  
  23. Can one refer to un.a and un.b by ((char) un) and ((long) un), respectively?
  24. Thanks
  25.  
  26. -- 
  27. Dimitris K. Agrafiotis
  28. Computer Assisted Drug Design
  29. Parke-Davis Pharmaceutical Research
  30. (agrafiot@wl.com)
  31.