Your code has many bugs, that include copy constructor, assignment operator, vector(int size, int &initialValue) methods.
A warning is not bad, but your bugs cause memory problems.
There are many sloppy mistakes, but one at a time.
Your class has three data members
1 2 3
int *arr;
int max_size;
int elements;
There certain things have to be true about them. They have to be true at the end of each constructor, the beginning of the destructor and the entry/exit of all other functions. We call these invariants. In your case:
1. arr must point to a block of allocated memory (your code doesn't cater for a NULL value)
2. max_size is zero or a positive number
3. elements is in the range [0, max_size)
Lets consider vector::vector(int size). It clearly doesn't respect these invariants.
Line 48: max_size and elements are not updated.
Line 53: max_size and elements are not updated.
Line 60: all updates are to a local 'vector' that goes out of scope at the end of the function.
Line 86: returns true when not empty.
Line 94: all updates are to a local 'vector' that goes out of scope at the end of the function.
Line 102: all updates are to a local 'vector' that goes out of scope at the end of the function.
Line 117: all updates are to a local 'vector' that goes out of scope at the end of the function.
Line 129: You let the compiler return junk when index is out of range.
Line 138: arr is not updated.