Right, I know that a char is 8 bits by definition, I just seem to remember some project property that would make chars 16 bits by default. But that really isn't the issue. I'm more worried about types like int, short, and long. int is 32 bits on most platforms, but can be 64 bits, things like that.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Byron Clark Sent: Monday, July 02, 2007 9:57 PM To: [email protected] Subject: Re: [uug] stdint.h On Mon, Jul 02, 2007 at 08:06:04PM -0600, Daniel Dilts wrote: > I know that this is almost heresy, but I am doing development in > VS2005. I need to guarantee the size of certain integer data types. > For instance I need an int that is 8 bits wide. Under GCC that should > be easy. A char is supposed to be 8 bits wide, but under VS2005 that > is not necessarily true, I don’t believe. By definition, a char is always one byte wide. So unless you have a platform that you care about (hint, VS2005 doesn't support any of these) where a byte is not 8 bits wide, you can always use a char (preferably unsigned) as an 8 bit type. > VS2005 doesn’t include the C99 headers like stdint.h. If it did, then > I could just use int8_t and the like. Is there a way to define these > types using the C preprocessor? No preprocessor involved: typedef char int8_t; typedef unsigned char uint8_t; -- Byron Clark No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.9.14/883 - Release Date: 7/1/2007 12:19 PM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.9.14/883 - Release Date: 7/1/2007 12:19 PM -------------------- BYU Unix Users Group http://uug.byu.edu/ The opinions expressed in this message are the responsibility of their author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________ List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
