Im trying to copy a whole .txt file into a char array. My code works but it leaves out the white spaces. So for example if my .txt file reads \"I Like Pie\" and i copy it to
A much simpler approach would be using the get() member function:
while(!myfile.eof() && i < arraysize) { myfile.get(array[i]); //reading single character from file to array i++; }