I am new to C++ programming but have a solid background in C#, Java and PHP. I see in C++ there are multiple ways to allocate and free data and I understand that when you call malloc you should call free and when you use the new operator you should pair with delete and it is a mistake to mix the...
@RMartinhoFernandes You mean, ask the question again, and wait for good answers to trickle in, while promising a bounty to raise the quality? That's a good idea – except that the question will be closed immediately as a dupe.
I am new to C++ programming but have a solid background in C#, Java and PHP. I see in C++ there are multiple ways to allocate and free data and I understand that when you call malloc you should call free and when you use the new operator you should pair with delete and it is a mistake to mix the...
The new keyword is the C++ way of doing it, and it will ensure that your type will have their constructor called. The new keyword is also more type safe whereas malloc is not typesafe at all.
@RMartinhoFernandes When I click on "start a bounty", I don't see any way to give a reason... Ah, I didn't dare to click on "Next" before. That seems good.
@RMartinhoFernandes Yeah, and I don't really worry about losing 500rep. What I am worried about, though, is that we might attract many, many answers with a bounty, many of which might be pretty good, but none definitive.
@RMartinhoFernandes I'm not a pessimist, but I'm too old to not to be a realist!
@Als That has drawbacks, too, though. For example, while many of us here are good enough to provide a good answer, that does by no means guarantee that we can collaboratively come up with a good answer. The result might be of frustratingly low quality, or this room might actually die in a horrible flame war, because we cannot agree on something.
@sbi: We Come up with one,We can then review if it is good enough(Let it stay, and take comments),and if we feel it is not definitive we let it stay and then start a bounty, that way the bounty hopefuls will be willing to meet the deficiencies of that answer.