c++/oop---stdlib中的一些函数

今天做一道逆波兰表达式,没有想到输入数据可能有负数,调了好久好久

-_-     ....

有几个可以用的函数

pow (db x, db y) 返回 x^y

atof (ch * x) 把 x 返回为一个浮点数 

如果x不全是数字,则返回最开始的部分

atof ("123dsss")=123

atof("haha") =0

(ascii to float)

 

atoi 

ascii to integer

 

itoa 

integer to ascii

char* itoa(int value,char*string,int radix);//value: 要转换的整数,string: 转换后的字符串,radix: 转换进制数,如2,8,10,16 进制等。

不过有些编译器似乎不能用 爬

posted @ 2022-04-10 08:56  liankewei123456  阅读(25)  评论(0编辑  收藏  举报