由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - C++里为什么没有标准化atoi和itoa?
相关主题
C++ string to int conversion新手问个初级问题, 面试coding的时候数字转字符串用itoa还是stringstream?
如何判断一个stringstream里面number的类型?问一个C++的小细节,和leetcode也有关
How to conver CString to long long type?请问一个C++题目
c++ string 一问,打击啊,程序没写出来
c++ stringstream: how to display hex 0 in 2 digits ?LC的compare version有点麻烦
相关话题的讨论汇总
话题: c++话题: numeric话题: atoi话题: string
进入Programming版参与讨论
1 (共1页)
g*********s
发帖数: 1782
1
很常用也有用。每次都要写三行stringstream,觉得麻烦。
t****t
发帖数: 6806
2
c++0x will have. [21.5 Numeric Conversions]
std::{ stoi, stol, stoul, stoll, stoull, stof, stod, stold }: string ->
numeric
std::{ to_string, to_wstring }: numeric -> string
the benefit of using stringstream is template friendly. if you are writing
templates, you wouldn't want a whole family of function names.

【在 g*********s 的大作中提到】
: 很常用也有用。每次都要写三行stringstream,觉得麻烦。
e****d
发帖数: 895
3
You can use boost::lexical_cast.

【在 g*********s 的大作中提到】
: 很常用也有用。每次都要写三行stringstream,觉得麻烦。
p***o
发帖数: 1252
4
atoi is part of the standard inherited from C90. You can find it in Table 49
of the C++98 standard.

【在 g*********s 的大作中提到】
: 很常用也有用。每次都要写三行stringstream,觉得麻烦。
1 (共1页)
进入Programming版参与讨论
相关主题
c++ stringstream: how to display hex 0 in 2 digits ?LC的compare version有点麻烦
新手问个初级问题, 面试coding的时候数字转字符串用itoa还是stringstream?C++ string to int conversion
问一个C++的小细节,和leetcode也有关如何判断一个stringstream里面number的类型?
请问一个C++题目How to conver CString to long long type?
打击啊,程序没写出来c++ string 一问,
相关话题的讨论汇总
话题: c++话题: numeric话题: atoi话题: string