Beginner: How does an object delete itself?

nobody somebody at somewhere.com
Sun Sep 21 08:15:22 PDT 2008


Hello. I just started using OOP and had a question.

I have something like this:

class Foo{
..
    private void deleteMyself()
    {
        this.delete;
        foo.length--;
    }
..
}

Foo[] foo;

But this obviously doesn't work.
The problem is, how do I know what position in the array the object is, and 
how do I delete it?
I don't want empty elements in my array. 




More information about the Digitalmars-d-learn mailing list