avatar
Unix上C++函数求救# Unix - 噫吁兮,危乎高哉
F*Q
1
在Unix上那个函数功能跟dos的itoa()类似,把一个数变成串?
我用fcvt/ecvt,cc总是报错:
"ptest.cpp", line 77.15: 1540-276: (S) Assignment to a
constant expression is not allowed.
请问应该怎么用?
多谢!
avatar
I*s
2
If you check C reference book you can find many ways to do
this, I think.
One way currently I'm using is sprintf function:
char intString[20];
int n = 10;
sprintf(intString, "%d", n);
then you can use intString other places.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。