我这样改了,在VC6.0下调试没有问题:
#include <iostream>
#include <algorithm>
using namespace std;
int main(int argc, char* argv[])
{
int setA[5] = {2,4,5,7,8};
int setB[7] = {1,2 ,3,4,5,6,7};
int setC[5] = {2,5,8,8,15};
int setD[6] = { 1,4,4,6,7,12};
int AunionB[10];
int AunionC[10];
int BunionD[15];
int AintersectB[10];
int AintersectC[10];
int *lastElem;
ostream_iterator<int> display(cout," ");
int AdifferenceB[10];
lastElem = set_difference(setA,setA+5,setB,setB+7,AdifferenceB);
cout<<"Line 74: AdifferenceB: ";
copy(AdifferenceB,lastElem,display);
cout<<endl;
int BsymDiffC[5];
lastElem = set_symmetric_difference(setB,setB+7,setC,setC+5,BsymDiffC);
cout<<"Line 80: BsymDiffC: ";
copy(BsymDiffC,lastElem,display);
cout<<endl;
return 0;
}
你上面的代码是用的UNICODE编译的吧