string中c_str()的用法

1.ios 語法:面試 1 const char *c_str(); c_str()函數返回一個指向正規C字符串的指針常量, 內容與本string串相同。shell 這是爲了與c語言兼容,在c語言中沒有string類型,故必須經過string類對象的成員函數c_str()把string 對象轉換成c中的字符串樣式。ubuntu 注意:必定要使用strcpy()函數 等來操做方法c_str()返回的
相關文章
相關標籤/搜索