What's in your file?
You can pass data by const&amp; as it's not being modified.
ARRAY_LENGTH should probably be an unsigned type, such as std::size_t.
Just to stay safe, terminate the program if the file cannot be opened:

if (!file)
{
    std::cerr &lt;&lt; "file cannot be opened";
    return EXIT_FAILURE;
}

You do not really need to call close() here.  It would only be necessary for checking for errors, otherwise the destructor will do this for you.  It shouldn't leak any resources.