StrToUInt

int StrToUInt (const char string[], unsigned int *unsignedIntegerValue);

Purpose

Attempts to convert a nul–terminated string to an unsigned integer value.

If the bytes in the nul–terminated string contain a valid ASCII decimal representation of an unsigned integer value, and there are no extraneous non–white–space characters in the string, this function returns 1. Otherwise, this function returns 0.

This function is similar to the C library strtoul function except in how extraneous characters are treated.

Parameters

Input
Name Type Description
string const char [] A nul–terminated string.
Output
Name Type Description
unsignedIntegerValue unsigned integer * The unsigned integer value represented by the characters in string.

If the characters in string are not a valid ASCII decimal representation of an unsigned integer value, or there are extraneous characters, this parameter is not modified.

Return Value

Name Type Description
success? integer If the bytes in the nul–terminated string contain a valid ASCII decimal representation of an integer value, and there are no extraneous non–white–space characters in the string, this function returns 1. Otherwise, this function returns 0.