In C++, you can assign a char* to a std::string because std::string has a constructor that accepts a const char* and creates a std::string object with the content of the C-style string. This implicit or explicit conversion allows you to work seamlessly with C-style strings and std::string objects.
why char * type can assign to string type
最新推荐文章于 2024-08-24 14:01:36 发布