itoa,atoi - confused [英] itoa, atoi - confused

查看:67
本文介绍了itoa,atoi - confused的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是C的新手,虽然我几年前做过。


我被告知itoa不再是标准功能了,那个

ato ...函数 - 虽然在std中 - 不推荐。


所以,我想知道itoa和atoi等有什么问题(以及什么是

取代了它们。)


非常感谢


ray

I''m pretty new to C, although I did do some years ago now.

I''ve been told that itoa is no longer a standard function, and that the
ato... functions - although in the std - are not recommended.

So, I was wondering what was wrong with both itoa and atoi etc (and what''s
replaced them).

Many thanks

ray

推荐答案

我又来了 - getch等发生了什么......我觉得我曾经知道的一切

已经消失了!

" rayw" < RA ********* @ gmail.com>在消息中写道

news:dh ********** @ news.ox.ac.uk ...
Me again - what happened to getch etc ... I feel like everything I once knew
has gone!
"rayw" <ra*********@gmail.com> wrote in message
news:dh**********@news.ox.ac.uk...
我很新C,虽然我现在已经做了几年了。

我被告知itoa不再是标准功能,而且
ato ...功能 - 虽然在std - 不推荐。

所以,我想知道itoa和atoi等有什么问题(以及它们取代了它们)。

非常感谢

ray
I''m pretty new to C, although I did do some years ago now.

I''ve been told that itoa is no longer a standard function, and that the
ato... functions - although in the std - are not recommended.

So, I was wondering what was wrong with both itoa and atoi etc (and what''s
replaced them).

Many thanks

ray



rayw< ra ********* @ gmail.com>写道:
rayw <ra*********@gmail.com> wrote:
我对C很新,虽然我几年前做过。

我被告知itoa不再是标准功能,并且
ato ...功能 - 虽然在标准 - 不推荐。


itoa *从来没有*是标准功能,并且确实不建议使用atoi系列功能


所以,我想知道itoa和atoi等有什么问题(以及它们取代了它们)。
I''m pretty new to C, although I did do some years ago now.

I''ve been told that itoa is no longer a standard function, and that the
ato... functions - although in the std - are not recommended.
itoa has *never* been a standard function, and the atoi family of fuctions
are indeed not recommended to use.

So, I was wondering what was wrong with both itoa and atoi etc (and what''s
replaced them).




itoa有什么问题主要是因为它没有标准化,所以

完全不可移植。 atoi(等)的问题在于,如果转换的数字不适合

所需的类型,你就不能进行正确的错误检查




要将字符串转换为整数,请使用strtol(等),并创建一个整数us sprintf的

字符串表示。

-

<在这里插入你最喜欢的报价。>

Erik Trulsson
er ****** @ student.uu.se


rayw< ra **** *****@gmail.com>写道:
rayw <ra*********@gmail.com> wrote:
我再次 - 发生了什么事等......我觉得我曾经知道的一切都已经消失了!


就像itoa ,getch从未成为标准C的一部分。如果你使用getch,

认为它是C的一部分,那么你认为你对C的了解很多就是

可能错了。


rayw < RA ********* @ gmail.com>在消息中写道
新闻:dh ********** @ news.ox.ac.uk ...
Me again - what happened to getch etc ... I feel like everything I once knew
has gone!

Just like itoa, getch has never been part of Standard C. If you used getch,
believing it was part of C, then much of what you thought you knew about C was
probably wrong.


"rayw" <ra*********@gmail.com> wrote in message
news:dh**********@news.ox.ac.uk...
我是C的新手,虽然我几年前我确实做过。

我被告知itoa不再是标准功能,并且
ato ...功能 - 虽然在std中 - 不是推荐。

所以,我想知道itoa和atoi等有什么问题(以及它们取代了它们)。

非常感谢

ray
I''m pretty new to C, although I did do some years ago now.

I''ve been told that itoa is no longer a standard function, and that the
ato... functions - although in the std - are not recommended.

So, I was wondering what was wrong with both itoa and atoi etc (and what''s
replaced them).

Many thanks

ray





-

<在这里插入你最喜欢的报价。> ;

Erik Trulsson
er******@student.uu.se


这篇关于itoa,atoi - confused的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆