Linux C函数库参考手册之数据转换函数

atof(将字符串转换成浮点型数)

#include <stdlib.h>
double atof(const char *nptr);

atoi(将字符串转换成整型数)

#include <stdlib.h>
int atoi(const char *nptr);

atol(将字符串转换成长整型数)

#include <stdlib.h>
long atol(const char *nptr);

ecvt(将浮点型数转换成字符串,取四舍五入)

#include <stdlib.h>
char *ecvt(double number, int ndigits, int *decpt, int *sign);

fcvt(将浮点型数转换为字符串,取四舍五入)

#include <stdlib.h>
char *fcvt(double number, int ndigits, int *decpt, int *sign);

gcvt(将浮点型数转换为字符串,取四舍五入)

#include <stdlib.h>
char *gcvt(double number, int ndigit, char *buf);

strtod(将字符串转换成浮点型数)

#include <stdlib.h>
double strtod(const char *nptr, char **endptr);

strtol(将字符串转换成长整型数)

#include <stdlib.h>
long int strtol(const char *nptr, char **endptr, int base);

strtoul(将字符串转换成无符号长整型数)

#include <stdlib.h>
unsigned long int strtoul(const char *nptr, char **endptr, int base);

toascii(将整型数转换成合法的ASCII码字符)

#include <ctype.h>
int toascii(int c);

tolower(将大写字母转换成小写字母)

#include <ctype.h>
int tolower(int c);

toupper(将小写字母转换成大写字母)

#include <ctype.h>
int toupper(int c);

Leave a Reply

Your email address will not be published. Required fields are marked *