I want to output "a" to the file in the function, how do I do it? The following gives me error.

```
#include <iostream> 
#include <fstream> 

using namespace std;

void outputfile(const char* file);

int main() 
{
    int a = 1;
    ofstream cc;
    cc.open("123.txt");
    if (cc.fail()) 
    {
        cout << "\nError in file opening" << endl;
        return(1);
    }
    outputfile("123.txt");
    cc.close();
    return 0;
}

void outputfile(const char* file)
{
    // I want to output a to the file, how can I do it? The following gives me error.
    file << a;
}

```

The problem is solved, thanks for answering the question.:)