Ticket #4576: unexpected-results.cpp

File unexpected-results.cpp, 478 bytes (added by Nate Silva <nate@…>, 12 years ago)

Example showing unexpected results (Windows-specific)

Line 
1#define BOOST_FILESYSTEM_VERSION 3
2
3#include <iostream>
4#include <boost/filesystem.hpp>
5
6int main()
7{
8 char buffer3[255] = "C:\\WINDOWS";
9 boost::filesystem::path p3(buffer3);
10 p3 /= "SYSTEM32";
11
12 for (boost::filesystem::directory_iterator it(p3);
13 it != boost::filesystem::directory_iterator(); it++)
14 {
15 // The paths printed will include extra characters
16 // between "WINDOWS" and "SYSTEM32".
17 std::cout << *it << std::endl;
18 }
19}