I have errors for the template can any1 see anything wrong???
//Array.h

//Header file for Array.cpp.
class Array
{

private:
	//Template for use with the Array's data type.
	//Member Variables.
	int size;
	int grow_size;
	int num_elements;







public:
//Functions.
template<class Datatype>
int m_size;
Datatype* m_array;


	//Consturctor.
	Array( int p_size)
 {
 m_array= new Datatype[p_size];
 size= p_size;
 }




	//Destructor.
	~Array()
 {
 if( m_array!= 0 )
 delete[] m_array;
 m_array= 0;
 }


};

Maybe it is not really the case, but IMO the whole class should be a template, not just one function or member...
Like:

template <class T>
class Array{
public:
	T* m_array;
}

Although it's 3:30 am and I might've gotten this wrong.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.