摘要: C++ Strings library std::basic_string Defined in header <string> int stoi( const std::string& str, std::size_t* pos = nullptr, int base = 10 );int sto 阅读全文
posted @ 2021-07-21 14:34 fire909090 阅读(398) 评论(0) 推荐(0) 编辑
摘要: string类是C++STL类之一,有很丰富的接口。 string类为空,实际也就是元素为0个。 可以按照如下方式判断: 1、string类有自己的成员函数empty, 可以用来判断是否为空。 string s; if(s.empty())//成立则为空 ... 2、判断字符串长度。如果长度为0,则 阅读全文
posted @ 2021-07-21 14:31 fire909090 阅读(3322) 评论(0) 推荐(0) 编辑