template的问题,赐教
template<class T>
class CArray3d
{
// Implementation
private:
T** m_pData; // the actual array of data
int m_nSize; // # of elements (upperBound - 1)
int m_nMaxSize; // max allocated
int m_nGrowBy; // grow amount
public:
// Construction
CArray3d()
{
m_pData = NULL;
m_nSize = 0;
m_nMaxSize = 0;
m_nGrowBy = 0;
}
// Destruction
~CArray3d()
{
delete [] (BYTE*)m_pData;
}
T* GetAt(int nIndex)
{
ASSERT(nIndex >= 0 && nIndex < m_nSize);
return m_pData[nIndex];
}
T** GetData() { return m_pData; }
// Add
int Add(T* newElement)
{
int nIndex = m_nSize;
SetAtGrow(nIndex, newElement);
return nIndex;
}
}我想知道T** m_pData像这种有星号的什么意思,为什么可以这样定义,它是怎么使用的,还有哪里有更多的关于模板的信息,谢谢