你怎麼就一根筋呢? STL之vector and string用還是不用

來源:互聯網
上載者:User

The minute you decide to use new for a dynamic allocation,you adopt the following responsebilities:

只要你決定動態開闢記憶體空間,你就有活幹了,下面的就是:

1 You must make sure that somebody will later delete the allocation.

你必須確保有哪個老幾會把他在不用的時候刪除,也許這個人就是你自己.

2 You must ensure that the correct form of delete is used.Only once deletion and for an array allocation,delete[] is required.

你必須確保它們被正確的刪除,只能而且只能被刪除一次,有時候還有一次性刪除一個數組.

That's quite a set of responsebilities,and I can't understand why you'd want to adopt them if it wasn't necessary.

你要管一大堆屁事,我真是搞不懂在不是不需那樣做的情況下你還屁顛屁顛的去使用它幹嗎?

Thanks to vector and string.It isn't necessary anywhere near as often as it used to be.

感謝vector,感謝string.它幾乎總是必要的.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.