Topic: Representation of data members in memory


Author: seibold@nvdv.e-technik.uni-stuttgart.dbp.de (Wolfram Seibold (Se))
Date: 5 Mar 1993 16:28:29 GMT
Raw View
Hi,

I have to transmit different c++ class-instantiations over stream-channels.
The classes are derived from a base-class containing a type-identifier
to determine the size of the class-instantiation. This type-identifier
must be transmitted first to ensure correct reception of the transmitted
data.

Therefore my question:

Does the c++ standard determine how data members are stored in memory??

Thanks in advance!

Wolfram Seibold




Author: pjl@cs.uiuc.edu (Paul Lucas)
Date: Sat, 6 Mar 1993 01:55:49 GMT
Raw View
In <1n7v3d$mks@info2.rus.uni-stuttgart.de> seibold@nvdv.e-technik.uni-stuttgart.dbp.de (Wolfram Seibold (Se)) writes:

>Hi,

>I have to transmit different c++ class-instantiations over stream-channels.
>The classes are derived from a base-class containing a type-identifier
>to determine the size of the class-instantiation. This type-identifier
>must be transmitted first to ensure correct reception of the transmitted
>data.

>Therefore my question:

>Does the c++ standard determine how data members are stored in memory??

 Nothing even close.  Transmit your member in the order you
 want them transmitted.
--
 - Paul J. Lucas
   AT&T Bell Laboratories
   Naperville, IL