data types

K.LAUX rkl1 at hound.UUCP
Sat Feb 4 03:24:29 AEST 1989


In article <3447 at sdsu.UUCP>, middleto at sdsu.UUCP (Tom Middleton) writes:
| 
| Someone suggested to me that the C data types for short and long were
| fixed at 16 and 32 bits respectively and that the int type size was
| allowed to float based on the word size of the machine.  This seems to
| fit with my experience but brings up the question.  What happens when
| you go to a 48 or 64 bit machine?  Does int then become 48 or 64 bits
| while long stays at 32?  And by any change was this the purpose of
| creating the short and long types?  Also, is this part of the standard
| or is it still under discussion?
| 

	I believe the Standard is the following:

	Int	is the default word size on the machine,
	Long	must be equal to or greater than the size of an Int,
	Short	must be equal to or less than the size of an Int.

	Therefore on a 64 bit machine:

	Int = 64 bits or 8 bytes,
	Long >= 64 bits or 8 bytes,
	Short <= 64 bits or 8 bytes.

--rkl



More information about the Comp.lang.c mailing list