[Solved] how to convert char * to boost::shared_ptr?
You cannot convert a string literal to a shared pointer. Let me just “correct” your code, and then all you have remaining is undefined behavior: const char *str = “abcdfg”; boost::shared_ptr<char> ss(str); Now, this will compile, but it will produce serious problems because str is not memory that was allocated dynamically. As soon as the … Read more