Article View: comp.std.c
Article #169Scalars and Structs
From: John D. Mitchell
Date: Thu, 30 Jul 1992 20:56
Date: Thu, 30 Jul 1992 20:56
17 lines
967 bytes
967 bytes
ANSI X3.159-1989: Section 3.3.4 Cast Operators: Constraints: "Unless the type name specifies void type, the type name shall specify qualified or unqualified scalar type and the operand shall have scalar type." Am I correct in taking this to mean that there is no way to cast a structure of known size to a scalar that just so happens to have the same size (or vice versa)? Is the right thing to do is to use a union? Or is there a better solution. Thanks, John johnm@cory.Berkeley.EDU
Technical Details
Message-ID:
<1992Jul30.205601.13276@pasteur.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!sdd.hp.com!uakari.primate.wisc.edu!ames!pasteur!cory.Berkeley.EDU!johnmShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sdd.hp.com!uakari.primate.wisc.edu!ames!pasteur!cory.Berkeley.EDU!johnm From: johnm@cory.Berkeley.EDU (John D. Mitchell) Newsgroups: comp.std.c Subject: Scalars and Structs Keywords: casts Message-ID: <1992Jul30.205601.13276@pasteur.Berkeley.EDU> Date: 30 Jul 92 20:56:01 GMT Sender: nntp@pasteur.Berkeley.EDU (NNTP Poster) Organization: University of California, at Berkeley Lines: 17 Nntp-Posting-Host: cory