C++ lexicographyal_compare 有什么用?
我想使用 C++ 算法库中的函数 lexicographyal_compare 。
但就 using 语句而言,我不知道该写什么。例如,
using std::lexicographical_compare ??
我将来如何为自己解决这个问题?
谢谢
I wan to user the function lexicographical_compare in algorithms library in c++.
But I do not know what to write as far as the using statement. For example
using std::lexicographical_compare ??
How can I figure this out for my self in the future?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
就这样做
,然后(复制自 SGI STL 文档)
或者
了解自己未来,从头到尾阅读一本 C++ 书籍(例如 Stroustrup 的《The C++ 编程语言》)。
Just do
and then (copied from SGI STL Doc)
Alternatively
To know yourself in the future, read a C++ book (e.g. Stroustrup's "The C++ Programming Language") from cover to cover.
你所拥有的很好 - 你还需要包含算法标头:
至于如何为自己找出这些东西,我强烈建议获取 C++ 标准库。
What you have is fine - you will also need to include the algorithm header:
As to how to find out these things for yourself, I strongly recommend getting a copy of The C++ Standard Library.
用法示例,来自 https://www.geeksforgeeks.org/lexicographyal_compare-in-cpp/< /a>
输出:
Usage example, from https://www.geeksforgeeks.org/lexicographical_compare-in-cpp/
output: