Guardian C Library Calls Reference Manual

stcd_i (supplementary)
3-176 128833Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
stcd_i (supplementary)
The stcd_i function converts a string of decimal characters to an integer.
str_ptr
points to the string to convert.
int_ptr
points to the variable of type int where stcd_i stores the converted value.
Return Value
is the number of characters scanned.
Usage Guidelines
The string to convert can contain an optional sign and then a string of digits.
The stcd_i function does not skip leading space characters.
The stcd_i function halts scanning when it encounters a non-decimal character.
Example
This example converts the string “234” to an integer:
#include <stdlibh>
#include <stdioh>
int main(void)
{
int result;
char *string;
int count;
string = "234";
count = stcd_i(string, &result);
printf("%d\n", result); /* prints "234" */
}
#include <stdlibh>
int stcd_i(char *str_ptr, int *int_ptr);