C++片段库
你知道 C++ 做的那些烦人的事情不是很直观,比如在自定义分隔符上分割字符串或创建动态扩展数组/向量...是否有任何片段库(我一直在到处看到 boost,如果有的话请告诉我)这就是解决方案),我应该知道吗?或者也许是一个拥有许多这样的网站,以便我可以刷新我的 C++ 知识......为此目的的任何内容都是可以接受的。
感谢SO社区!
You know those annoying things that C++ doesn't do very intuitively, like splitting strings on custom delimiters or creating dynamically expanding arrays/vectors... is there any snippet library (I keep seeing boost all over the place, please let me know if that is the solution), that I should be aware of? Or maybe a website that has a number of them so that I can refresh my knowledge of C++... anything to that end is acceptable.
Thanks SOCommunity!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您给出的两个特定示例都包含在标准库中 - 用于分割字符串的
stringstream
和getline()
以及用于动态数组的vector
。那应该是第一个看的地方;当标准库不能满足您的需求时,Boost 是一个很好的资源。
The two particular examples you give are both covered by the standard library -
stringstream
andgetline()
to split strings, andvector
for a dynamic array.That should be the first place to look; Boost is a good resource when the standard library doesn't meet your needs.
对于动态扩展向量,您应该使用 STL。
For dynamically expanding vectors, you should be using the STL.