+ 6
You don't get errors when you give %d but get a warning.
The size of() function expects a long unsigned int type but when you give %d it's only int type. When you write, %ld it means long int . It works without any error.
But the best one is:
%lu
Because using %lu means long unsigned int which is the type of specifier that sizeof() use.
You can have a look at this question:
https://stackoverflow.com/questions/21128092/d-expects-argument-of-type-int-but-argument-2-has-type-long-unsigned-int