What, exactly, is a (*) and how do you cast it?
"error C2440: '=' : cannot convert from 'char *[]' to 'char (*)[]'"
Trying to get a SmartPointer to take array values. Header:
template <typename T> class SmartPointer
{
private:
T* myPtr;
int* count;
public:
T* Value();
SmartPointer(const SmartPointer<T>& a)
{
myPtr = a.myPtr;
count = a.count;
++*count;
}
SmartPointer(T* ptr);
SmartPointer(T value) { myPtr = &value; count = new Int(); ++*count; }
~SmartPointer();
void operator =(T a);
operator T*();
T* operator ->();
};
Relevant calling line:
SmartPointer<char[]> str = SmartPointer<char[]>(new char[20]);