[bo][un]yangweiwei[/un] 在 2008-10-11 14:36 的发言:[/bo]
哦,谢谢楼上,c_str()是类string的函数吗?
是的,
它把string转为C风格字符串...
详见:
basic_string::c_str
const E *c_str() const;
The member function returns a pointer to a nonmodifiable C string constructed by adding a terminating null element (E(0)) to the controlled sequence. Calling any non-const member function for *this can invalidate the pointer.