Casting a Boost FileSystem3 iterator to a const char*
问题 I'm looping over some file in a directory using Boost FileSystem 3 and I need to cast the filename to a char* for another lib, Unfortunately my C++ foo is lacking, can anyone help ? int main(int argc, char* argv[]) { path p (argv[1]); // p reads clearer than argv[1] in the following code try { if (exists(p)) // does p actually exist? { if (is_regular_file(p)) // is p a regular file? cout << p << " size is " << file_size(p) << '\n'; else if (is_directory(p)) // is p a directory? { cout << p <<