I’m c++ newbie and i’m a little bit confused with this code:
var *pointer=new(sharemem) var();
I’ve honestly tried to found similar question, but it was unsuccessful. I think because of my english.
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.
That is not a cast, it is called “placement new” and you can read about it here: https://en.wikipedia.org/wiki/Placement_new
It is essentially constructing a new
varin pre-allocated memory pointed to bysharemem.