Well I've taken the task up for myself.
But I need some help
here's my current code
Code:
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main (void)
{
int lesschar1;
int maxchar1;
string wordlist1;
cout << "Wordlist Cleaner" << endl;
cout << endl;
cout << "Remove words with LESS then how many characters?: ";
cin >> lesschar1;
cout << endl;
cout << "Remove words with MORE then how many characters?: ";
cin >> maxchar1;
cout << endl;
cout << "Drop a Wordlist here to begin cleaning: ";
cin >> wordlist1;
cout << endl;
string line;
ifstream words;
words.open (wordlist1.c_str());
if (words.is_open());
{
while (! words.eof() )
{
getline (words,line);
cout << line << endl;
}
words.close();
}
system("PAUSE");
return 0;
}
All it does so far is display a whole text file for me, but I'm trying to use strlen to get the length of "line" but it's not working.
Code:
{
getline (words,line);
cout << line << endl;
}
Right now the line prints out what ever is in my text file but I can't make it get a length of a word from it, I need some help :]