Ticket #6819: path.cpp
File path.cpp, 460 bytes (added by , 11 years ago) |
---|
Line | |
---|---|
1 | #include <boost/filesystem/path.hpp> |
2 | #include <iostream> |
3 | |
4 | struct c_struct |
5 | { |
6 | int foo; |
7 | int bar; |
8 | char flexible_buf[1]; |
9 | }; |
10 | |
11 | int main() |
12 | { |
13 | c_struct *p = (c_struct *)malloc(1000); |
14 | strcpy(p->flexible_buf, "a-long-string-disguised-as-char[1]"); |
15 | |
16 | boost::filesystem::path path1(p->flexible_buf); |
17 | std::cout << path1 << std::endl; |
18 | |
19 | boost::filesystem::path path2("base"); |
20 | path2 /= p->flexible_buf; |
21 | std::cout << path2 << std::endl; |
22 | } |
23 |