When should i use the pointer and when not?
Whats the better Way?
Must i delete the cat object of the pointer at the end of the programm?
Example:
cat piki;
piki.miao();
cat *piki2 = new cat();
piki2->miao();
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
pikiobject will be autodeleted when the current scope is closed.piki2must be explicitly deleted.