Hi everyone,
need some help, this function doesnt work for me and I dont know why, maybe you can help me.

Code:
void menu4(double array[], int n) {
    ofstream results("results.txt"); 
    for (int i = 0; i < n ; i++)
    {
        results << array[i] << " ";
        cout << array[i] << endl;
    }
    results << endl;
}
'cout' is printing the array elements, but in file i dont see nothing