concatenation operator "/"



#include <filesystem>
#include <iostream>
                                                                                                         
using std::filesystem::path,
    std::cerr;

int main(){
    char buffer[50]{"/home/person\0"};
    path p1(buffer, path::generic_format);
    char buf[20]{"text.txt\0"};
    path p2(buf, path::generic_format);

    path new_path = p1 / p2;

    cerr << "new path: " << new_path.string() << "\n";

    return 0;
}      
C++ Examples© 2024 TBD