I’ve been trying to figure out how to do this for a while and Ijust can’t figure it out. I need to code in C++ a program thattakes an existing text file with words and reads it into an array.Then from the array, i need to display the words. I also need tohave most of the code outside of the int main function by using aclass.
Solution
#include <fstream>#include <vector>#include <iostream>using namespace std;class Filereader { private: vector<string> words; public:
OR
OR