Hi every one I have a big problem, I need help with creating a program which reads every third word in a text file and excludes puncuation like -,?.!'" etc.. so far none of my work need code or suggestions just plain help(newb)
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
ifstream input ( "text.txt" );
string my_string;
int counter = 0;
while (!input.eof)
{
if (count ==2 )
{
cout<<"hey you hit the third line " << my_string;
}
count += 1;
}
read.close();
cin.get();
}
of
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{ string filename
ifstream input;
input.open("sh_text.txt");
string word;
int count=0;
if(input.fail())
{
cout << "error";
}// end of if loop
else
{
while(!input.eof())
{
input >> word;
count++;
if(count%3==0);
{
count=0;
cout << "word" <<endl;
}// end of if loop
}// end of while loop
}// end of else loop
return (0);
}// end of program
:)