For me I have no problem saying:
CMyClass myclassinst;
I think its reference to use of the default constructor is just as clear as some explicit notation. Perhaps that''s just a preference but I have yet to see code contrary to this style.
Using delete:
Again, my personal opinion, but I would not recommend letting you''re application''s exit free heap regardless of the variable''s scope and status in the life of the program. Considering memory leaks are a pain in rear I think it is wise to track every new you do and make sure you clean up each one regardless. Otherwise you''ll eventually code one thing and mean other and wind up with memory leaks.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement