Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   Object /pointer life time in C++ (http://www.go4expert.com/forums/object-pointer-life-time-cpp-t28831/)

stefan12 4Aug2012 13:58

Object /pointer life time in C++
 
Hello all,

I added some classes to ns-2 network simulator for my project. The classes communicate to each other by sending messages using tcp protocol. When I am running simulations some times objects are destroyed before simulation ends.

I would appreciate if some one shares me about object life time in c++ and how Linux system handles applications that consume large memory and CPU time.

I can post some part of the code if required.

thanks,

xpi0t0s 13Aug2012 21:07

Re: Object /pointer life time in C++
 
Object lifetime is unlimited. Objects get freed when you free them and not before. C++ is not Java and there is no garbage collector.


All times are GMT +5.5. The time now is 18:55.