I would like to read the content from the text file by C++ , I wrote the code as below:
#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <fstream>
using namespace std;
int main(int argc, char const *argv[])
{
    ifstream input("C:\\Users\\thang\\Desktop\\Thang\\output.txt");
    string str;
    while(!input.eof()) //check if it goes to the end of the file
    { 
        //getline(input,str); //
        input>>str; // get the value of str from the file 
        cout<<str<<endl;
    }
    return 0;
}
But it just show me the result with no empty row , but the output.txt file has the empty line.
I have attached the screenshot

Could you please help explain why it get the result without the empty line ? Appriciated for all assist.

 
     
    