4 template<typename type>
13 array((type *) ourcalloc(1, sizeof(type) * _size)),
18 Array(type *_array, uint _size) :
19 array((type *) ourmalloc(sizeof(type) * _size)),
21 memcpy(array, _array, _size * sizeof(type));
24 Array(Array<type> *_array) :
25 array((type *) ourmalloc(sizeof(type) * _array->size)),
27 memcpy(array, _array->array, size * sizeof(type));
30 void init(uint _size) {
31 array = (type *) ourcalloc(1, sizeof(type) * _size);
35 void init(type *_array, uint _size) {
36 array = (type *) ourmalloc(sizeof(type) * _size);
38 memcpy(array, _array, _size * sizeof(type));
41 void init(Array<type> *_array) {
42 array = (type *) ourmalloc(sizeof(type) * _array->size);
44 memcpy(array, _array->array, size * sizeof(type));
52 type get(uint index) const {
56 void set(uint index, type item) {
64 type *internalArray() {