std::string str = "abc"; const char *p = str.data();
更多: https://www.cnblogs.com/devilmaycry812839668/p/6353807.html