C++ & STL
C++ & STL 等相关整理
基础语法
using
1 | using ... = ...; |
在语法的别名声明,using的使用类似于typedef,但用法更为精妙。
string
stoi
1 | int stoi (const string& str, size_t* idx = 0, int base = 10); |
stoi()的输入要不为空,否则可以使用atoi(().c.str())
sstream
istringstream类用于执行C++风格的字符串流的输入操作,支持>>;
ostringstream类用于执行C++风格的字符串流的输出操作,支持<<;
stringstream类同时可以支持C++风格的串流的输入输出操作,同时支持>>和<<;
即 stringstream = istringstream + ostringstream。
STL
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.