Edit of M.M's answer to make a C/C++ function specific for IPv4 addresses; forcing use of valid address input and buffer length for output:
bool ipv4_addr_to_str(uint8_t (*ipv4_addr)[4], char (*str)[16])
{
bool success = false;
if (ipv4_addr != NULL && str != NULL)
{
memset(*str, 0, 16);
snprintf(*str, sizeof(*str), "%d.%d.%d.%d",
(*ipv4_addr)[0], (*ipv4_addr)[1], (*ipv4_addr)[2], (*ipv4_addr)[3]);
success = true;
}
return success;
}