This website works better with JavaScript.
首頁
探索
說明
登入
felix
/
ftb
關註
1
收藏
0
複製
0
程式碼
問題管理
0
合併請求
0
版本發佈
0
Wiki
Activity
瀏覽代碼
arraylsits can now reserve
banana-cakes
Felix Brendel
6 年之前
父節點
635af49d52
當前提交
7d8eabf479
共有
1 個文件被更改
,包括
7 次插入
和
0 次删除
分割檢視
Diff Options
Show Stats
Download Patch File
Download Diff File
+7
-0
arraylist.hpp
+ 7
- 0
arraylist.hpp
查看文件
@@ -51,6 +51,13 @@ struct Array_List {
next_index++;
}
void reserve(unsigned int count) {
if (next_index+count <= length) {
length *= 2;
data = (type*)realloc(data, length * sizeof(type));
}
}
type& operator[](int index) {
return data[index];
}
Write
Preview
Loading…
取消
儲存