Specific sizes of variable types
- From: "gamehack" <gamehack@xxxxxxxxx>
- Date: 21 Jan 2006 13:53:04 -0800
Hi all,
I'm writing an application which will be opening binary files with
definite sizes for integers(2 byte integers and 4 byte longs). Is there
a portable way in being sure that each integer will be exactly 2 bytes?
Should I have a platform dependent header file which checks for
CHAR_BIT and sizeof(int) etc and have a few typedefs like int16, long32
etc.
<OT>
If I have to go non-portable, then what's the way to determine the
sizes before compilation and typedef accordingly?
</OT>
Thanks
.
- Follow-Ups:
- Re: Specific sizes of variable types
- From: tmp123
- Re: Specific sizes of variable types
- From: pete
- Re: Specific sizes of variable types
- From: Christian Bau
- Re: Specific sizes of variable types
- From: Malcolm
- Re: Specific sizes of variable types
- From: Thad Smith
- Re: Specific sizes of variable types
- From: Rod Pemberton
- Re: Specific sizes of variable types
- From: Gordon Burditt
- Re: Specific sizes of variable types
- From: Keith Thompson
- Re: Specific sizes of variable types
- From: Flash Gordon
- Re: Specific sizes of variable types
- From: Mike Wahler
- Re: Specific sizes of variable types
- Prev by Date: Re: Selling my computer
- Next by Date: Re: Selling my computer
- Previous by thread: Selling my computer
- Next by thread: Re: Specific sizes of variable types
- Index(es):
Relevant Pages
|
|