蓝森林首页 | 返回主页 | 本站地图 | 站内搜索 | 联系信箱 | -->
 您目前的位置:首页 > 自由软件 > 技术交流 > 应用编程 -->


    

蓝森林 http://www.lslnet.com 2006年8月16日 14:08

RH7.2怎么没有itoa这个函数?

有什么替代的吗?

Re: RH7.2怎么没有itoa这个函数?

snprintf/sprintf

Re: RH7.2怎么没有itoa这个函数?

if you are using in c++,
you can use std::streamstring



Re: RH7.2怎么没有itoa这个函数?

谢谢你!

搞定了!

Re: RH7.2怎么没有itoa这个函数?

谢谢你!

能否给个简单的小例子?

Re: RH7.2怎么没有itoa这个函数?

char a[12];
int i = 78;
sprintf(a,"%d",i);

Re: RH7.2怎么没有itoa这个函数?

std::stringstream buf;

int i=10;
buf<<a;

_____________
std::string a;
buf>>a;



或者直接使用buf.str();

Re: RH7.2怎么没有itoa这个函数?

谢谢!

搞定了!

Re: RH7.2怎么没有itoa这个函数?

多谢!





Copyright © 1999-2000 LSLNET.COM. All rights reserved. 蓝森林网站 版权所有。 E-mail : webmaster@lslnet.com