mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-24 18:11:38 +00:00
Added explanation of size_t
This commit is contained in:
parent
07b5c4934c
commit
c4c8c02df9
@ -81,7 +81,7 @@ int main() {
|
|||||||
// is not evaluated (except VLAs (see below)).
|
// is not evaluated (except VLAs (see below)).
|
||||||
// The value it yields in this case is a compile-time constant.
|
// The value it yields in this case is a compile-time constant.
|
||||||
int a = 1;
|
int a = 1;
|
||||||
// size_t is an unsiged integer type of at least 2 bytes used to represent the size of an object
|
// size_t is an unsiged integer type of at least 2 bytes used to represent the size of an object.
|
||||||
size_t size = sizeof(a++); // a++ is not evaluated
|
size_t size = sizeof(a++); // a++ is not evaluated
|
||||||
printf("sizeof(a++) = %zu where a = %d\n", size, a);
|
printf("sizeof(a++) = %zu where a = %d\n", size, a);
|
||||||
// prints "sizeof(a++) = 4 where a = 1" (on a 32-bit architecture)
|
// prints "sizeof(a++) = 4 where a = 1" (on a 32-bit architecture)
|
||||||
|
Loading…
Reference in New Issue
Block a user