Skip to main content
Skip table of contents

IPToNumber [LJM User's Guide]

Takes a decimal-dot IPv4 string representing an IPv4 address and outputs the corresponding integer version of the address.

Syntax

LJM_ERROR_RETURN LJM_IPToNumber(

const char * IPv4String,

unsigned int * Number)

Parameters

IPv4String [in]

A decimal dot string representing an IPv4 address.

Number [out]

The numerical representation of IPv4String.

Returns

LJM errorcodes or 0 for no error. Returns LJME_INVALID_PARAMETER if IPv4String could not be parsed as an IPv4 address.

Remarks

Use this function to convert a human-readable interpretation of an IP address into an integer value.

Example

Convert an IPv4 string into a number.

C
int LJMError;
unsigned int Number;
 
LJMError = LJM_IPToNumber("192.168.1.207", &Number);
printf ("%u \n", Number);
// prints 3232235983
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.