谁给我个STL实现的简单例子呀
我在VC++ 6.0+ SP5 下编译候捷的那本《泛型编程于STL》那本书的第一个例子就通不过,到底要包含哪些库呀?怎么设置?
#include <IOSTREAM>
#include <VECTOR>
int main()
{
vector<string> V;
string tmp;
while(getline(cin,tmp))
V.push_back(tmp);
sort(V.begin(),V.end());
copy(V.begin(),V.end(),ostream_iterator<string>(cout,"\n"));
return 0;
}