compilation error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rahul

    #1

    compilation error

    Hi Everyone,

    I get the error on the following code,

    error C2027: use of undefined type 'B'

    class AA
    {
    public: operator B()
    {
    B obj;
    printf("in B\n");
    return obj;
    }
    };

    class B
    {
    public: operator AA()
    {
    AA obj;
    printf("in AA\n");
    return obj;
    }
    };

    int main()
    {
    AA obj;
    B b_obj;
    obj = b_obj;
    b_obj = obj;
    return(0);
    }

    Thanks in advance!!!
Working...