ZEDA
1.6.18
|
Macros | |
#define | itoa_zerofill(v, s, b) itoa_fill( (v), (s), '0', (b) ) |
convert an integer to a string with blank filled by a charactor-zero. More... | |
Functions | |
int | atox_c (char c) |
convert a hexadecimal note to a value. More... | |
int | atox (char *str) |
convert hexadecimal string to value. More... | |
char * | itoa (int val, char *buf) |
convert an integer to a string. More... | |
char * | ftoa (double val, char *buf) |
convert a d-float value to a string. More... | |
char * | itoa_fill (int val, int size, char pat, char *buf) |
convert an integer to a string with a blank filled by a charactor. More... | |
char * | itoa_ordinal (int val, char *buf, size_t size) |
convert an integer number to a string that represents an ordinal. More... | |
#define itoa_zerofill | ( | v, | |
s, | |||
b | |||
) | itoa_fill( (v), (s), '0', (b) ) |
convert an integer to a string with blank filled by a charactor-zero.
int atox_c | ( | char | c | ) |
convert a hexadecimal note to a value.
atox_c() converts a charactor c which denotes a hexadecimal value to an integer value.
int atox | ( | char * | str | ) |
convert hexadecimal string to value.
atox() converts a string str which denotes hexadecimal value to an integer value.
if c is neither 0-9 nor a-f, it warns and returns zero. if str includes non-hexadecimal charactors, it warns and skips them. Ex. a string "1g2h3i" is converted to 102030.
char* itoa | ( | int | val, |
char * | buf | ||
) |
char* ftoa | ( | double | val, |
char * | buf | ||
) |
char* itoa_fill | ( | int | val, |
int | size, | ||
char | pat, | ||
char * | buf | ||
) |
convert an integer to a string with a blank filled by a charactor.
itoa_fill() converts a given integer val to a string with its blank filled by pat. size is the length of the string. If the digit of val is more than size, size is ignored.
Examples:
1.when calling itoa_fill( 12, 5, '*', buf );, the string will be "***12".
2.when calling 'itoa_fill( 123, 2, '?', buf );', the string will be "123".
char* itoa_ordinal | ( | int | val, |
char * | buf, | ||
size_t | size | ||
) |
convert an integer number to a string that represents an ordinal.
itoa_ordinal() converts an integer number val into a string that represents an ordinal, and stores it into buf. size is the size of buf.