Like with a variable?
You can build the file name using a stringstream
eg:
1 2 3 4 5
std::stringstream ss; // requires header <sstream>
int number = 55;
ss << "./text" << number << ".txt";
ss.str().c_str(); // will return the C string with the contents if the stream, you can use it as argument to ifstream constructor