I learned C# first, and now I\'m starting with C++. As I understand, operator new in C++ is not similar to the one in C#.
new
Can you explain the reason of
When creating object2 you're creating a copy of the object you created with new, but you're also losing the (never assigned) pointer (so there's no way to delete it later on). To avoid this, you'd have to make object2 a reference.
object2