class MyString()
{
MyString()
{
}
~MyString()
{
delete m_pText;
}
{
size_t length = strlen(pText);
m_pText = new char[length];
}
private:
m_pText;
}
{ return 0;
}
- Class declaration is wrong ended with ().
- Type for m_pText is not specified.
- Class declaration closing brace is not ended with semicolon
- m_pText should be deleted as delete[] and not just delete.
- you cant take the strlen of pointer as if it is not null terminated one it will give wrong results.
Comments