خرید بک لینک

Vote count: 0

I have a class myclass . In the main function, I create objects of myclass in every iteration and want to delete them after each iteration. I have not created the objects dynamically. Can I delete the them explicitly because I dont need them after the iteration gets over.

    class myclass{
    int value;
    };

    int main()
    {
    for(int i=0;i<count;i++)
    { 
    myclass obj;
    obj.do_function();
    }
    }

The object obj is no more needed after one iteration,but the memory is still there. How can I free that memory?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 20 تير 1395 ساعت: 15:34

صفحه بندی