assistance with array class

i have this array class that i need to make it so instead of being restricted to just ints it can take anykind of variable. here is the code for the class
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 class array
                {public:
                        int & operator [] (int);  //Prototype; overloaded operator
                        int size ()
                                {return ub-lb + 1;
                                };
                        int lbound ()
                                {return lb;
                                        };
                        int ubound ()
                                {return ub;
                                        };
                        array (int, int); //User specifies subscripts
                        array (int);            //User specifies number of elements
                                array ();               //Default constructor

        private:
                int *list;                      //Dynamic array
        int lb;                         //Lower bound of array; set by user
        int ub;                         //Upper bound of array; set by user
                };

we are supposed to use a template or something and i tried making one that took different types as parameters but i couldn't get it to work so im not sure if thats was the right path
Topic archived. No new replies allowed.