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 int | 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 | int | 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. |
Additional Information
Library: Programmer's Toolbox
Include file: toolbox\toolbox.h
LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later
Example
Refer to functionpanels\Customization\SelectColor.cws for an example of using the StrToUInt function.