itob
2024-11-29
Exercise 3-5 from K&R, there's just something so satisfying about nailing an elegant solution in an instant...
char const DIGITS = ;
/* converts integer n into a base b character representation into string s
* let's assume base 16 as max val
*/
void
And yes, not super impressive, this is a simple exercise, and for nailing this to be happy about means I'm pretty darn stupid most of the time (spoiler: I am...), but hey... take the wins you have, and abuse them for motivation. Just a few more years and I might be half-decent at this?