In some platform, int32_t
(from stdint.h) is long int
, but in other platform, it could be int
. When I want to use printf
, how can I determine which format, "%ld"
or "%d"
, should be used?
Or, perhaps, I should force converting it to long like below:
int32_t m;
m = 3;
printf ("%ld\n", (long)m);
But that solution is tedious. Any suggestions?