i got a pointer to char in my class that would later be used to reference a char array
the size in unknown to me , and for that reason i want to refere to it as char*
i can’t seem to assign it the value of null.
it is only shown as Bad Ptr exception
how can i initalize it so in my ctor i could allocate space for the “char array”
this is what i am trying to accomplish, seems simple enough if it was written in c.
ctor
{
if( m_data != NULL )
m_data = new char[m_size];
}
Don’t test uninitialized data for NULL, just do: