why the output text is empty?

I was using this program for select a set of data from a txt file and create a histogram:

#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <cmath>

using namespace std;

int GetPowerOfTen(unsigned int i){
    if(i==0) return 0;
    else return (int)log10(i);
}

int main(int argc, char* argv[]){

    //Variables containing general information are declared here
    string inputFileName;
    string outputFileName = "output.txt";
    int rebinFactor = 1;

    if(argc < 2){
        cout << "Error: not enough parameters!" << endl;
        cout << "For help type " << endl;
        cout << "./RawToHisto -h " << endl;
        return -1;
    }

    //User interface
    for(int i=1; i<argc; i++){
        string option = string(argv[i]);

        if( option == "-h" || option == "--help" ){
            cout << "Usage:n";
            cout << "./RawToHisto [options, ...] n";
            cout << "t-intfilenametttSpecify input file namen";
            cout << "t-outtfilenametttSpecify output file name (default is output.txt)n";
            cout << "t-rebint[#]tttSpecify rebin factor (default is 1)n";
            cout << endl;
            return 0;
        }

        if ( option == "-in"){
            inputFileName = string(argv[++i]);
            continue;
        }

        if ( option == "-out"){
            outputFileName = string(argv[++i]);
            continue;
        }

        if ( option == "-rebin"){
            rebinFactor = stoi(argv[++i]);
            continue;
        }

        cout << "Option " << option << " not implemented" << endl;
        return -1;
    }

    cout << "Converting raw data to histogram format with the following parameters:n";
    cout << "Input file name: " << inputFileName << "n";
    cout << "Output file name: " << outputFileName << "n";
    cout << "Rebin factor: " << rebinFactor << "n";
    cout << endl;

    //Here we open the input file
    ifstream fin (inputFileName.c_str());
    if(!fin.is_open()){
        cout << "Error: cannot open input file " << inputFileName << endl;
        return -1;
    } else cout << "Input file opened" << endl;

    //Here we open the output file
    ofstream fout (outputFileName.c_str());
    if(!fout.is_open()){
        cout << "Error: cannot open output file " << inputFileName << endl;
        return -1;
    } else cout << "Output file created" << endl;

    //first we load all the input data in a vector
    string temp;
    vector<int>data;
    while(getline(fin,temp,',')){
        data.push_back(stoi(temp));
    }
    cout << "Data loaded in memory" << endl;
    cout << "Size of vector is " << data.size() << endl;

    int powerOfTen;

    int binAdded = 0;
    double binCenter = 0;
    double binContent = 0;

    for(unsigned int i=0; i<(data.size()-1); i++){

        powerOfTen = GetPowerOfTen(i);
        switch(powerOfTen){
            case 0: binCenter+=data.at(i) % 10 + 0.5; break;
            case 1: binCenter+=data.at(i) % 100 + 0.5; break;
            case 2: binCenter+=data.at(i) % 1000 + 0.5; break;
            case 3: binCenter+=data.at(i) % 10000 + 0.5; break;
            default: cout << "Error: powerOfTen is " << powerOfTen << endl; break;
        }
        
        powerOfTen = GetPowerOfTen(i+1);
        switch(powerOfTen){
            case 0: binContent+=data.at(i+1) / 10; break;
            case 1: binContent+=data.at(i+1) / 100; break;
            case 2: binContent+=data.at(i+1) / 1000; break;
            case 3: binContent+=data.at(i+1) / 10000; break;
            default: cout << "Error: powerOfTen is " << powerOfTen << endl; break;
        }
        binAdded++;

        if(binAdded == rebinFactor){
            //we calculate the average as the binCenter
            binCenter = binCenter / binAdded;

            fout << binCenter << "t" << binContent << "n";

            binAdded = 0;
            binCenter = 0;
            binContent = 0;
        }
    }

    //check if we wrote the last bin
    if(binAdded != 0){
        //we calculate the average as the binCenter
        binCenter = binCenter / binAdded;

        fout << binCenter << "t" << binContent << "n";
    }

    cout << "nRaw data successfully converted to histogram format" << endl;

    return 0;
}

but when I run it from the terminal the output file is totaly blank and I don’t know why, I’m sorry for this stupid question but I’m new to Mac OS and when I run this program for the first time I was using linux and there everything worked fine

Jack@airjack dati % g++ -Wall rawtohisto.cpp -o histo
Jack@airjack dati % ./histo -in dati1min.txt -out dati1.txt
Converting raw data to histogram format with the following parameters:
Input file name: dati1min.txt
Output file name: dati1.txt
Rebin factor: 1

Input file opened
Output file created
Data loaded in memory
Size of vector is 1

Raw data successfully converted to histogram format

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật