O'Reilly logo
  • LI WEI thinks this is interesting:

To print a C++ string, you must use the string.c_str() function:string s = "Hello"; printf( "string %s\n", s.c_str() );The s.c_str() function accesses the C pointer to the string, which printf needs

From

Cover of Learning C++ by Creating Games with UE4

Note

用c的方式输出string