
The “Hello World” Program
C version:
1 |
#include <stdio.h> |
C++ version:
1 |
#include <cstdio> |
Sizes of types
- The size of types (in bits/bytes) can vary in C/C++
- For different compilers/operating systems
-
In Java, sizes are standardised, across O/Ss
- An int changes size more than other types!
– Used for speed (not portability), but VERY popular! (fast) – Uses the most efficient size for the platform
– 16 bit operating systems usually use 16 bit int
– 32 bit operating systems usually use 32 bit int
– 64 bit operating systems usually use 64 bit int - sizeof() operator exists to tell us the size




近期评论