i have
Tree<std:string> tree;
now
new Tree<std:string>;
leads to a pointer,
how can i change address of tree to that of pointer generated by new?
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.
Making C++ code look like Java is a bad idea, the two languages are very different.
That said, in C++ operator
newreturns a pointer to the allocated object.You can also bind a reference to your object.
I urge you not to do that. Writing
->instead of.is not that difficult.