Guardian C Library Calls Reference Manual

Reference to Library Calls
Guardian TNS C Library Calls Reference Manual128833 3-179
stci_d (supplementary)
stci_d (supplementary)
The stci_d function converts a signed integer to a string of decimal characters.
str_ptr
points to the string where stci_d stores the converted decimal value.
integer
is the integer to convert.
outlen
is the size of the array pointed to by str_ptr.
Return Value
is the length of the resulting string, excluding the terminating null character.
Usage Guidelines
The stci_d function does not copy leading zeros to the output string. The output
string is terminated with a null character.
If the integer is negative, the output string is preceded by a negative sign.
If the integer is zero, a single zero character is produced.
Example
This example converts the integer 2001 to a string of decimal characters:
#include <stdlibh>
#include <stdioh>
int main(void)
{
int num;
size_t length;
char string[10];
num = 2001;
length = stci_d(string,num,10); /* convert to */
/* string form */
printf("%s",string); /* prints "2001" */
}
#include <stdlibh>
int stci_d(char *str_ptr, int integer, int outlen);