TIP: Click on subject to list as thread! ANSI
echo: cis.languages
to: David Breeding 72330,2051 (X)
from: Pete Lyall 76703,4230
date: 1994-06-26 10:25:22
subject: #20067-#Coco/OSK C compilers

#: 20073 S3/Languages
    26-Jun-94  10:25:22
Sb: #20067-#Coco/OSK C compilers
Fm: Pete Lyall 76703,4230
To: David Breeding 72330,2051 (X)

This isn't a bug, nor is it abnormal for compilers written for machines with
larger wordsizes. The reason is that the CPU needs to make an address reference
to a certain address boundary, usually on a multiple of the wordsize. Internal
to the structure, they call this 'padding'.

If you need to write the structure to disk in a semi-portable fashion, you'll
have to write out each element individually:

        write(fd,struct->element1,sizeof(struct->element1);
        write(fd,struct->element2,sizeof(struct->element2);
        etc.......

Pete Lyall

There is 1 Reply.

SOURCE: compuserve via textfiles.com

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