NumberToIP [LJM User's Guide]
Takes an integer representing an IPv4 address and outputs the corresponding decimal-dot IPv4 address as a null-terminated string.
Syntax
LJM_ERROR_RETURN LJM_NumberToIP(
unsigned int Number,
char * IPv4String)
Parameters
Number [in]
A number representing an IPv4 address.
IPv4String [out]
A character array which will be updated to contain the null-terminated string representation of an IPv4 address. Must be allocated to size LJM_IPv4_STRING_SIZE
.
Returns
LJM errorcodes or 0
for no error.
Remarks
Use this function to get a more human-readable interpretation of an IP address.
Example
Convert a number into an IPv4 string.
int LJMError;
char IPv4String[16];
LJMError = LJM_NumberToIP(3232235983, IPv4String);
printf ("%s \n", IPv4String);
// Prints "192.168.1.207"