#include "stdafx.h"
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
voidPrintInt(const int&nData)
{
cout<<nData<<endl;
}
int_tmain(int argc, _TCHAR* argv[])
本文展示了如何使用C++的`swap`函数快速地交换两个`vector`容器中的内容。通过创建两个整数向量并填充数据,然后调用`swap`函数进行交换,最后打印交换后的结果,验证了交换过程。
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
voidPrintInt(const int&nData)
{
cout<<nData<<endl;
}
int_tmain(int argc, _TCHAR* argv[])

被折叠的 条评论
为什么被折叠?