I am trying to read a text file and store each different word seperately using an array and whitespace as a delimiter. Example: Input from file is "I wish I knew how to do this" and I want to store "I" as word, "wish" as word, "I" as word, "knew" as word, "how" as word etc.
Here is what I have so far:
when I compile I get:
using namespace std;
int index = 0;
cin.get(myfile, word[index], ' ');
cout << word[index] << endl;
.\main.cpp(17) : error C2664: 'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::get(_Elem *,std::streamsize,_Elem)' : cannot convert parameter 1 from 'std::ifstream' to 'char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Any help is greatly appreciated. Thanks in advance for your time.