#include #include struct c_struct { int foo; int bar; char flexible_buf[1]; }; int main() { c_struct *p = (c_struct *)malloc(1000); strcpy(p->flexible_buf, "a-long-string-disguised-as-char[1]"); boost::filesystem::path path1(p->flexible_buf); std::cout << path1 << std::endl; boost::filesystem::path path2("base"); path2 /= p->flexible_buf; std::cout << path2 << std::endl; }