字符串与数值相互转换的函数

来源:互联网 发布:淘宝怎么恢复极速退款 编辑:程序博客网 时间:2024/05/16 15:37

atoi、atof、itoa、itow函数是windows平台下实现字符串与数值相互转换的函数【参考】

 

atoi函数

原型:int atoi( const char *string );

ASCII to integer

作用:将字符串转为integer类型

 

atof函数

原型:double atof( const char *string );

ASCII to float

作用:将字符串转为double类型

 

_itoa函数

原型:char *_itoa( int value, char *str, int radix );//2<=radix<=36

Integer to ASCII

作用:将Integer类型转换为radix进制,然后以ASCII字符串的形式存放在str中

 

_itow函数

wchar_t * _itow( int value, wchar_t *str, int radix ); //2<=radix<=36

Integer to Wide Char

作用:将Integer类型转换为radix进制,然后以宽字符串的形式存放在str中

原创粉丝点击