AmmarHaddadi / 1337-cursus

0 stars 0 forks source link

`+` #3

Open AmmarHaddadi opened 4 days ago

AmmarHaddadi commented 4 days ago

+ (Plus flag)

Note:

Example test cases:

printf("|%#10x|\n", 42);     // |    0x2a2a|
printf("|%+10d|\n", 42);     // |       +42|
printf("| %10d|\n", 42);     // |        42|
AmmarHaddadi commented 4 days ago

no need to hack into itoa(), just check if it returns a string that doesn't start with - and print +