Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

need help

[code]#include
#include
using namespace std;
int main(int arg, char*args[])
{
istream&getline(istream&is,string str,char delimiter);
vector*retrieve_text()
{
string file_name;
cout<<"please enter file name:";
cin>>file_name;
ifstream infile(file_name.c_str(), ios::in);
if(!infile)
{
cerr<<"sorry,can't open the file"<<file_name<<endl;
exit(-1);
}
else cout<<endl;
vector<string,allocator>*line_of_text=new vector;
string textline;
string texline;
typedef pairstats;
stats maxline;
int linenum=0;
while(getline(infile,textline,'
';))
{
cout<<"line read:"<<textline.size())
if(maxline.first<<textline.size())
{
maxline.first=textline.size();
maxline.second=lineum;
}
lines_of_text->push_back(textline);
lineum++;
}
return lines_of_text;
}
system("pause");
return 0;

}[/code]

//there are batch of error in the visual 2010 compiler
Sign In or Register to comment.