TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ANTHONY TIBBS
from: LEE KIRBY
date: 1998-01-02 21:27:00
subject: Extra bytes

On 24-Dec-97 at 12:00, Anthony Tibbs wrote to Lee Kirby:
 LK>> The way I count, this structure should be only 190 bytes, but if I do 
 LK>> a sizeof( fMsg), it reports 192!
 > I added it all together, and the structure IS 192.
 > Assumptions:  ?short is two bytes, time_t is 4, and the strings are 
 > whatever you said.
Hmm...I still get 190.  I believe the solution is that the compiler allocates 
a chunk of memory that is divisible by 2 for efficiency's sake.
       struct header {
036      char from[ 36 ];
036      char to[ 36 ];
072      char subj[ 72 ];
020      char date[ 20 ];
002      ushort timesRead;
002      sshort toNode;
002      sshort fromNode;
002      ushort cost;
002      sshort fromNet;
002      sshort toNet;
004      time_t dateWritten;
004      time_t dateArrived;
002      ushort replyTo;
002      ushort attr;
002      ushort nextReply;
       };
===
190
--- Msged 4.20 beta 2
---------------
* Origin: Sirius BBS * Portland, OR (503) 291-1908 * V.34 (1:105/24)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.