How do I also read a new line using C++ >> operator?
ifstream input(\"doc.txt\".c_str());
vector contents;
while (input >> word) {
conten
First off , you are already passing as const char * in the constructor of the stream. Secondly , the stream reader reads characters not space , this is how it knows when to cut to strings.
Usually we read a binary file , there is a character known by the reader that tells when we skip a line the famous \n but its differents from platforms(Win , Unix).