RE: [Dev-C++] int and long int sizes
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <iv...@em...> - 2003-09-01 09:20:08
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Andr? Macario Barros
> Sent: Monday, September 01, 2003 6:13 AM
> To: Dev-Cpp-Users
> Subject: [Dev-C++] int and long int sizes
>
>
> Dear Users,
>
> printf("%d\n", sizeof(long int));
> and
> printf("%d\n", sizeof(int));
>
> produces the same value, 4.
>
> Is there no more difference between a int and a long int?
C & C++ standards do not require the types to be different. The size of a
type is implementation dependent. The only restriction that exists is that
sizeof(char)==sizeof(signed char)==sizeof(unsigned char)==1 byte.
So in theory an implementation is allowed to have sizeof(long)=1.
Ioannis Vranos
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
|