TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: LEE KIRBY
from: LAURI NURMI
date: 1997-12-29 20:01:00
subject: Extra bytes

> I'm very new to C++, and can't figure out why I get two extra bytes when I
> write this structure to a file:
> The way I count, this structure should be only 190 bytes, but if I do a
> sizeof( fMsg), it reports 192!
You didn't tell your compiler, but I think the compiler adds so many extra 
bytes that size of the struct is divisible by 4. (4 bytes=32 bits) This 
somehow makes the programs faster.
--- BBBS/2 v3.33 How
---------------
* Origin: Looks expensive... (2:224/808.1)

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™.