Admin Production ni-theme
Current Publication

atoi

LabWindows/CVI

atoi

int atoi (const char stringInput[]);

Purpose

Converts the initial portion of a string to an int representation. This function is equivalent to the following:

(int) strtol(stringInput, (char **) NULL, 10)

Parameters

Input
Name Type Description
stringInput const char [] Contains a pointer to the character sequence from which a conversion is made.

Return Value

Name Type Description
convertedValue int Contains the converted value, if any. If no conversion is possible, the function returns zero. If the correct value is outside the range of representable values, atoi returns LONG_MAX or LONG_MIN, according to the sign of the value, and sets errno to ERANGE.

Additional Information

Library: ANSI C Library

Include file: ansi_c.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Example

Refer to networkvariable\NVConfig\nvconfig.cws for an example of using the atoi function.