creating new files in new folder?

hello. considering the following code:
1
2
3
4
5
6
7
std::vector<int> vec(10);
    for(size_t n=0; n<vec.size(); n++){
        vec[n] = 10;
        std::string str = "ents\\" + std::to_string(n) + ".data";
        std::cout << str << std::endl;
        std::ofstream file(str, std::ios::binary);
    }


i was expecting the creation of a new folder "ents", with 10 files, "0.data" to "9.data". but nothing is created. if i change the string to:
std::string str = std::to_string(n) + ".data";
i have 10 files in the current folder. but i want them to be in a separated folder. what am i doing wrong?

i'm using C++14 in Debian.

thanks in advance
Last edited on
i found what was wrong. i should use "/" instead of "\". so the string should be:
std::string str = "ents/" + std::to_string(n) + ".data";
Topic archived. No new replies allowed.