Test function.
52{
53 const int MAX_SIZE = 100;
54 char *str1 = (
char *)
calloc(
sizeof(
char), MAX_SIZE);
55 char *str2 = (
char *)
calloc(
sizeof(
char), MAX_SIZE);
56
57 for (int i = 1; i <= 100; ++i)
58 {
59
60 int value = rand() % 100;
61
62
63
64 snprintf(str1, MAX_SIZE, "%o", value);
66 snprintf(str1, MAX_SIZE, "%d", value);
68 snprintf(str1, MAX_SIZE, "%x", value);
70 }
71
74}
char * int_to_string(uint16_t value, char *dest, int base)
Converts an integer value to a null-terminated string using the specified base and stores the result ...
Definition int_to_string.c:25
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition malloc_dbg.h:26
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition malloc_dbg.h:22