string::size_type

Rate this post

C++ Primer 4/e 在string這裡有一個很好的練習:『Any variable used to store the result from the string size operation ought to be of type string::size_type. It is particularly important not to assign the return from size to an int.』

中文版的是這樣說:『任何用以存放string size()返回值的變數都應該是string::size_type型別。千萬別把size()返回值賦予一個int變數,切記。』

記起來,這樣就不會忘記。

achi’s English Blog

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

點我分享到Facebook

發佈留言

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