Right now I have a simple program that copies a file and outputs the content of the file into whatever file I name so when I type ./file text.txt output.txt it copies the content correctly but creates a new line at the end of output.txt when I try diffing it. can anyone tell me why and how to solve it
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char *argv[])
{
    ifstream fin;
    fin.open(argv[1], ios::in);
    ofstream fout;
    fout.open(argv[2], ios::out);
    char getChar;
    while (!fin.eof())
    {
        fin.get(getChar);
        fout << getChar;
    }
    fin.close();
    fout.close();
    return 0;
}
 
     
    