Admin Production ni-theme
Current Publication

StrToInt

LabWindows/CVI

StrToInt

int StrToInt (const char string[], int *integerValue);

Purpose

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

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.

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

Parameters

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

If the characters in string are not a valid ASCII decimal representation of an 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