#include <string>
#include <iostream>
int main()
{
int a = 5;
std::string filename = "file" + std::to_string(a) + ".txt";
std::cout << "The filename is: " << filename << std::endl;
// if you need a const char*:
const char* ptr = filename.c_str();
std::cout << "As a pointer: " << ptr << std::endl;
}
CiNpbmNsdWRlIDxzdHJpbmc+CiNpbmNsdWRlIDxpb3N0cmVhbT4KCmludCBtYWluKCkKewogICAgaW50IGEgPSA1OwogICAgc3RkOjpzdHJpbmcgZmlsZW5hbWUgPSAiZmlsZSIgKyBzdGQ6OnRvX3N0cmluZyhhKSArICIudHh0IjsKCiAgICBzdGQ6OmNvdXQgPDwgIlRoZSBmaWxlbmFtZSBpczogIiA8PCBmaWxlbmFtZSA8PCBzdGQ6OmVuZGw7CgogICAgLy8gaWYgeW91IG5lZWQgYSBjb25zdCBjaGFyKjoKICAgIGNvbnN0IGNoYXIqIHB0ciA9IGZpbGVuYW1lLmNfc3RyKCk7CiAgICBzdGQ6OmNvdXQgPDwgIkFzIGEgcG9pbnRlcjogICIgPDwgcHRyIDw8IHN0ZDo6ZW5kbDsKfQo=