#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
ifstream inFile;
inFile.open("words.txt");
if (inFile.fail()) {
cerr << "Error Opening File " << endl;
exit(1);
}
string item;
int count = 0;
while (!inFile.eof()) {
inFile >> item;
count++;
}
cout << count << " Word identified!" << endl;
//cout << "All Words" << words << endl;
}
I've looked up multiple guides on youtube and I've still got no answer even after copying people's code. Right now I've tried to make a code we're in Visual studio I have a resource file called words.txt and even though I'm trying to input the words into my code It's still not responding with anything and I have a count to identify how many words there is and there clearly isn't 1.