C语言之数字转化为字符串的库函数(The number of C languages is converted into a library function of strings)
C语言之数字转化为字符串的库函数(The number of C languages is converted into a library function of strings)
Q-how can worry about, like a river flows to the east. Changying in hand today, when bound dragon? Ewha Rongrong courtyards, energy-saving. A thousand miles to meet, no cross, not met. Try to burn the jade for three days, and the wood must be planted for seven years. The C language is converted into a string library function
Published: 13:18 yesterday | classification: personal diary read: (1) comments: (0)
What we used to do are as follows:
1, Itoa
Function: converts a long plastic to a string.
Usage: char, *Itoa (long, value, char, *string, int, Radix);
Detailed explanation: Itoa is English long, integer, to, array (long int long integer into a string, and save the value in the array string) abbreviation.
Parameter:
Value: long integer to be converted.
Radix: is the meaning of the base, that is, the first value into the radix hexadecimal number, range of 2-36, such as 10 for the 10 hexadecimal, and 16 for the 16 hexadecimal.
* string: saves the converted strings.
Return value:
Char *: points to the generated string, the same as *string.
Note: the header file of this function is "stdlib.h"".
2, Ultoa
Function: converts an unsigned long plastic to a string.
Usage: char, *Ultoa (unsigned, long, value, char, *string, int, Radix);
Detailed explanation: Uitoa is English unsigned long integer to array (unsigned, long, int, unsigned long integer into a string, and the value stored in the array string) abbreviation.
Parameter:
Unsigned long integers to be converted to value.
Radix: is the meaning of the base, that is, the first value into the radix hexadecimal number, range of 2-36, such as 10 for the 10 hexadecimal, and 16 for the 16 hexadecimal.
* string: saves the converted strings.
Return value:
Char *: points to the generated string, the same as *string.
Note: the header file of this function is "stdlib.h"".
3, Gcvt
Function: converts floating point numbers to strings, and take