Hello, Karl!

On Sun, 5 Jul 1998, Karl F. Larsen wrote:

>       I am learning to write C and yesterday tried to write a program
>that used sizeof() and it is broken in my version of compiler. No matter
>what kind of variable, the Linux sizeof() returns 4. I went back to my old
>Borland DOS compiler and it works there.
>
>       Please write this simple program on your Linux and see what you
>get:
>
>/* checks the function sizeof() */
>#include <stdio.h>
>int main(void)
>{
>       printf("The size of an integer is %d bytes.\n", sizeof(int));
>       return 0;
>}
>
>       This prints 4 in Linux and 2 (which is correct) using Borland C++.

different platforms defines different variables to different sizes.
In Linux, sizeof(int) is 4 and this is correct.

Bye.
--
Your heart is pure, and your mind clear, and your soul devout.

--
    With best of best regards, Pawel S. Veselov (aka Black Angel)
                   Internet e-mail : [EMAIL PROTECTED]
    Web page : http://www.druid.ml.org/~vps/ | ICQ UIN : 5252265

Reply via email to