std::vector<std::string> dirs;
dirs.push_back( "/usr" ); // This works; std::string is constructible from a const char*
dirs.push_back( std::string( "/usr" ) ); // Same thing, but construction is explicit
// Now comparing strings is easier than char*:
if( dirs.front() == "/root" )
std::cout << "Root directory\n";
// compared to:
if( strcmp( dirs.front(), "/root" ) == 0 )
std::cout << "Root directory\n";
I agree with helios but the other point is still valid. Comparing string to const char* is much easier and intuitive with operator==. Of course this is all conjecture without being able to see an example that demonstrates the original problem. There could be many other problems, although I agree with the suggestions. std::string will make life easier and the program will be more intuitive, safer, and easier to maintain. It'll also allow you to focus on the requirements of the program instead of on reinventing the wheel.