Library string Type and String Literals

Rate this post

C++ Primer 4/e 在string這裡有一個警告:『For historical reasons, and for compatibility with C, character string literals are not the same type as the standard library string type. This fact can cause confusion and is important to keep in mind when using a string literal or the string data type.』

中文版的是這樣說:『由於歷史因素和C相容性,字元字串字面常數(character string literals)的型別和C++標準庫的string型別並不相同。這可能會造成困惑。在使用字串字面常數或string型別時,這是一件必須放在心上的重要事情。』

嗯,我很習慣C的用法,改到C++時確實不太瞭解這之間的差別。

achi’s English Blog

本站部分內容包含聯盟行銷連結。當您透過連結購買商品或服務時,本站將獲得微薄的佣金,這並不會影響您的購買價格,但能支持本站的運作,感謝您的支持。問題詢問

點我分享到Facebook

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *