I am writing a simple c++ program in Xcode which has one class Message. In my main I want to declare a new Message and add this to a list messages. Xcode is suggesting I use:
messages.push_front(*new Message(messageID));
Can anyone explain what the *new does. Am I dynamically allocating memory for the Message object or is it creating a instance of Message on the stack? I have checked in Xcode and there are no memory leaks if use this and do not delete the instance so I assume it is allocating on the stack.