I need to override an operator = But in this func = I need to allocate some memory also call some functions which has a return result. How do I handle it? For instance MyClass& MyClass:perator = ( const MyClass & other) In this function I need to call malloc() or some other functions which may fail, if malloc fail, what should I return?