I would like to convert an integer to a string like:
int a = 12345
coverts to
char b[6] = "12345"
basically the opposite of the atoi function that converts a string to an integer.
#include <stdio.h>
int sprintf(char *str, const char *format, ...);
Example
char str[10];
sprintf(str,"%d", 12345);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With