strcat expects file to be a null-terminated string. This means it is an array of char with a zero value on the end. You have made an array of char, named file, with random values in it. Set the first char to zero to mark the end of the c-style string (i.e. to mark it as an empty c-style string).
As an aside, if you're going to code in C++, use std::string instead of an array of char. It's so much safer and easier.