1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

error case in operator =

Discussion in 'C++' started by Alex, Apr 12, 2009.

  1. Alex

    Alex New Member

    Oct 1, 2006
    Likes Received:
    Trophy Points:
    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::eek: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?

Share This Page