this is my c++ code
const int num_of_file = 1024;
std::ifstream data("data.txt");
std::vector<std::ofstream> files(num_of_file);
for (int i = 0; i < num_of_file; ++i)
{
files[i].open(std::to_string(i) + ".txt");
if (files[i].is_open() == false)
{
std::cerr << "open " << std::to_string(i) << ".txt fail" << std::endl;
exit(0);
}
}
but i received "open 509.txt fail" when i run the code every time.