Hi,
i have a question about using new/delete classes. This is a simle outline of the code:

class a {

blah blah blah

    class b {
        blah blah blah

        class c {
            blah blah blah
        };

    };
};

int main (){
    a newA;
    a::b newC;
    a::b::c newC;
    //to call fucntions
    newA.blah
    newB.blah
    newC.blah
}

//but i neeed to use new and delete, so how would that work?
int main (){
    A *newA = new A;
    A::B *newB = new A::B???
    ....
    ....
    delete newA;???

}

Any help would be appriciated

ok i figured: it should be
A *newA = new A;
A::B *newB = new A::B
A::B::C *newC = new A::B::C
and then delete newA etc...

but i dont seem to figure how to call the methods from newA/newB/newC :(

nvm..its
newA->blah
newB->blah
newC->blah

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.