V
VonTöppel
Hi!
Is there a simple way to drop numbers from integer value with string
formatting? Here's my problem:
int year = 2008;
printf("%02d", year);
It now prints "2008", but I would like it to print just "08". I could
subtract 2000 from the orginal value but I was wondering whether there's
another, more beutiful way to solve this.
Is there a simple way to drop numbers from integer value with string
formatting? Here's my problem:
int year = 2008;
printf("%02d", year);
It now prints "2008", but I would like it to print just "08". I could
subtract 2000 from the orginal value but I was wondering whether there's
another, more beutiful way to solve this.