看下面的英文解释: const char* c_str ( ) const;Get C string equivalentGenerates a null-terminated sequence of characters (c-string) with the same content as the string object and returns it as a pointer to an array of characters.A terminating null character i…
1. c_str是把string类型强制转换为const string 2. atpi(): Convert string to integer --Parses the C-string str interpreting its content as an integral number, which is returned as a value of type int. int atoi (const char * str); atol:Convert string to long inte…