what is the logic to count number of objects created implicitly and explicitly inside the same program..Please help.
laavanya 0 Newbie Poster
Recommended Answers
Jump to PostStart with the number zero, and each time an object is created, add one.
That's the logic.
If you mean something like creating a class, and counting how many times an object of that class is created, put the functionality to do the counting inside the constructor and make the …
Jump to PostDon't forget that you will need to add the counter increment to the copy constructor and the assignment operator. You probobly want to have that as a seperate counter since those objects will be implicitly created.
All 6 Replies
Moschops 683 Practically a Master Poster Featured Poster
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
phorce 131 Posting Whiz in Training Featured Poster
NathanOliver 429 Veteran Poster Featured Poster
phorce 131 Posting Whiz in Training Featured Poster
laavanya 0 Newbie Poster
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.