C++ char*转string_C++字符指针转换为字符串对象 程序猿 • 2025年12月19日 10:37:17 • 好文分享 • 阅读 0 将char*转换为std::string可通过构造函数直接实现,如std::string str(cstr);需确保指针非空且指向以’