I'm not sure how this compiles. std::string insert[] = {};
This is a string array with 1 element: an empty string. insert[i] >> in;
in has to be on the left hand side of operator>>.
When i = 1, you will be accessing an element outside the bounds of the array, resulting in undefined behaviour. Consider using a vector. std::cout<<insert[i]<<"/n";
It's '\n' and not '/n'.
If a C style array is used, either estimate the size of the array, ie number of words to be encountered and apply limits to the read to ensure no undefined behaviour or, make a first read of the file to count the number of words and then a second read to fill the array.
forgot but i think ostream where you could read the text in there as data. I really forgot. Just came on here to review c++ and see what others have for questions
forgot but i think ostream where you could read the text in there as data. I really forgot. Just came on here to review c++ and see what others have for questions
ifstream is used for file input. ofstream is used for file output.