不知道怎么修改
错误提示说:first use this function 请问我应该怎么修改好呢。当第一次使用函数的时候要注意些什么呢。!
using namespace std;
int main(){
vector<string> names;
string const endinput("END");
cout << "type '" << endinput << "' when there are no more names.\n\n";
for( int finished(0); finished != 1; ){
cout << "type in the next name; ";
string fullname;
getline( cin, fullname );
if( endinput == fullname )
finished = 1;
else
names.push_back( fullname ) ;
}
sort( names.begin(), names.end());
ofstresam outfile("name.txt");
for( int i(0); i != names.size(); ++i ){
cout << names[i] << '\n';
outfile << names[i] << '\n';
}
}