|
-
March 26th, 2013, 09:27 AM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|