I have a header file, but I don't know how to do it: I am new to templates.

template <class T> 
class Array 
        Array(int l, int h);
        Array(int s);
        Array(const Array& other);
        T& operator[](int index);
        const T& operator[](int index) const;
        int get_size() const 
        {return size;}
        int low;
        int  high;
        int size;
        int offset;
        T *ptr;  

Include the implementation of the class in the header file too. Without getting into excessive detail, template classes and member function definitions aren't split across multiple files.

I implemented this one in my main. And, i have to make declerations to each. How do I declare it? I wrote it like this:

template <class T>
T Array<T>::Array (int l, int h)
    if (l>h)
        cout<<"Bad number!\n"<<endl;
        exit (1);
        low = l;
        high = h;
        for (int i=0; i<size; i++)