#include <iostream>
#include <string>
#include <fstream>
#include <vector>
using namespace std;
int main () {
vector<string> vecTest;
string test[4];
fstream testing("testing.txt");
for (int i = 0; i < 2; i++){
getline(testing, vecTest.at(i), ' ');
cout << vecTest.at(i);
}
return 0;
}
My goal is to be able to take a file, read it in, cycle through the words and check if they match anything. I want to use a vector instead of an array so the number of elements can be flexible.

New Topic/Question
Reply


MultiQuote



|