STM32 core 3.0.1-dev
Arduino core for STM32 based boards: API reference
← STM32duino documentation
Loading...
Searching...
No Matches
itoa.c File Reference

Integer to ASCII conversion: itoa(), utoa(), ltoa() and ultoa(). More...

#include <string.h>

Functions

char * ltoa (long value, char *string, int radix)
 Convert a long to a null-terminated string.
 
char * ultoa (unsigned long value, char *string, int radix)
 Convert an unsigned long to a null-terminated string.
 
char * itoa (int value, char *string, int radix)
 Convert an int to a null-terminated string.
 
char * utoa (unsigned value, char *string, int radix)
 Convert an unsigned int to a null-terminated string.
 

Detailed Description

Integer to ASCII conversion: itoa(), utoa(), ltoa() and ultoa().

Function Documentation

◆ itoa()

char * itoa ( int  value,
char *  string,
int  radix 
)

Convert an int to a null-terminated string.

Parameters
valueValue to convert. Negative values are only signed for radix 10.
stringBuffer to write the result to. Must be large enough for the result.
radixBase to use, from 2 to 36.
Returns
Pointer to string, or NULL if string is NULL or radix is out of range.

◆ ltoa()

char * ltoa ( long  value,
char *  string,
int  radix 
)

Convert a long to a null-terminated string.

Parameters
valueValue to convert. Negative values are only signed for radix 10.
stringBuffer to write the result to. Must be large enough for the result.
radixBase to use, from 2 to 36.
Returns
Pointer to string, or NULL if string is NULL or radix is out of range.

◆ ultoa()

char * ultoa ( unsigned long  value,
char *  string,
int  radix 
)

Convert an unsigned long to a null-terminated string.

Parameters
valueValue to convert.
stringBuffer to write the result to. Must be large enough for the result.
radixBase to use, from 2 to 36.
Returns
Pointer to string, or NULL if string is NULL or radix is out of range.

◆ utoa()

char * utoa ( unsigned  value,
char *  string,
int  radix 
)

Convert an unsigned int to a null-terminated string.

Parameters
valueValue to convert.
stringBuffer to write the result to. Must be large enough for the result.
radixBase to use, from 2 to 36.
Returns
Pointer to string, or NULL if string is NULL or radix is out of range.