home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / std / c / 2392 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  938 b 

  1. Path: sparky!uunet!usc!sdd.hp.com!uakari.primate.wisc.edu!ames!pasteur!cory.Berkeley.EDU!johnm
  2. From: johnm@cory.Berkeley.EDU (John D. Mitchell)
  3. Newsgroups: comp.std.c
  4. Subject: Scalars and Structs
  5. Keywords: casts
  6. Message-ID: <1992Jul30.205601.13276@pasteur.Berkeley.EDU>
  7. Date: 30 Jul 92 20:56:01 GMT
  8. Sender: nntp@pasteur.Berkeley.EDU (NNTP Poster)
  9. Organization: University of California, at Berkeley
  10. Lines: 17
  11. Nntp-Posting-Host: cory
  12.  
  13. ANSI X3.159-1989:
  14.     Section 3.3.4 Cast Operators:
  15.         Constraints:
  16.             "Unless the type name specifies void type, the type
  17.             name shall specify qualified or unqualified scalar
  18.             type and the operand shall have scalar type."
  19.  
  20. Am I correct in taking this to mean that there is no way to cast a
  21. structure of known size to a scalar that just so happens to have the same
  22. size (or vice versa)?
  23.  
  24. Is the right thing to do is to use a union?  Or is there a better solution.
  25.  
  26.  
  27. Thanks,
  28.     John
  29.     johnm@cory.Berkeley.EDU
  30.