@Acme has a good thought, using printf()
format specifier %d
for a size_t
value is wrong.
On my Linux amd64 system, sizeof(int) = 4 and sizeof(size_t) = 8. That might be a problem.
It seems to work fine for me (perhaps the lack of a newline character after the second printf()
statement is confusing you?) but due to the size_t vs int format specifier mismatch, the results are undefined.
$ ./size
12 12
48$