CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #2
    Join Date
    Dec 2012
    Posts
    7

    Re: Need help with reading and outputting files

    the way I took out punctuation:

    CODE::

    while(!text1.eof())
    ----{
    -----------text1 >> str;
    -----------text1Vector.push_back(str);
    -----------for(int j = 0;j < text1Vector.size(); j++)
    -----------{
    --------------string& str = text1Vector[j];
    --------------for(int k = 0; k < str.length(); k++)
    --------------{
    ------------------if (ispunct(str[k]))
    ------------------{
    ---------------------str.erase(k, 1);
    ------------------}
    --------------}
    -----------}
    -------cout << str << " ";
    -----}
    Last edited by abub93; March 26th, 2013 at 09:30 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured