you could also write:
std::stringstream infile;		
infile << "/input_" << std::setfill( '0' ) << std::setw( 3 ) << id << ".txt";
return infile.str();