-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray.h
More file actions
40 lines (31 loc) · 719 Bytes
/
Array.h
File metadata and controls
40 lines (31 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
I designed this array class because I could and because I might need it for an
odd school project. It has a similar interfact to the standard array, but it
does not yet have the ability to initialize with an initializer list. The
initializer list support may or may not be added in the future.
Copyright Christopher Almquist 2013
*/
#ifndef ARRAY_H
#define ARRAY_H
template<class T>
class Array
{
public:
Array(int length);
~Array();
int getSize();
T& at(int element);
T& operator[] (int element)
{
return at(element);
}
// to do
/*T* operator= (int element)
{
// stuff
}*/
private:
int size;
T *p;
};
#endif // ARRAY_H