本文实例讲述了C++之boost::array的用法,分享给大家供大家参考。具体如下:
复制代码 代码如下:
#include <string>
#include <iostream>
#include <boost/array.hpp>
#include <algorithm>
using namespace std;
int main()
{
boost::array<int, 5> array_temp = {{12, 8, 45, 23, 9}};
sort(array_temp.begin(), array_temp.end());
#include <iostream>
#include <boost/array.hpp>
#include <algorithm>
using namespace std;
int main()
{
boost::array<int, 5> array_temp = {{12, 8, 45, 23, 9}};
sort(array_temp.begin(), array_temp.end());
copy(array_temp.begin(), array_temp.end(), ostream_iterator<int>(cout, " "));
return 0;
}
希望本文所述对大家的C++程序设计有所帮助。
相关文章
猜你喜欢
- 个人服务器网站搭建:如何选择合适的服务器提供商? 2025-06-10
- ASP.NET自助建站系统中如何实现多语言支持? 2025-06-10
- 64M VPS建站:如何选择最适合的网站建设平台? 2025-06-10
- ASP.NET本地开发时常见的配置错误及解决方法? 2025-06-10
- ASP.NET自助建站系统的数据库备份与恢复操作指南 2025-06-10