does anybody know how to use a variable when declaring an fstream file? Here's what I want to do:

//this code is just an example, not a problem
for (x=0; x <10;x++)
{
ofstream file("file(x).txt");
file<<"Hi, peeps!";
file.close();
}

this code would create ten files, each named file(x) (x being a number 1-10).

How can I do this?