My manager always telling me to use delete []. I don't know why? Can u tell me plz??? Is C is the only langz to usz delete???
Printable View
My manager always telling me to use delete []. I don't know why? Can u tell me plz??? Is C is the only langz to usz delete???
Uh oh, this does not bode well.
You should delete[] what you new[], but also read Stroustrup's FAQ on How do I deal with memory leaks?Quote:
Originally Posted by Yarlini Amirthanesan
Your question was for C++, not C. It sounds like you're confused and clueless enough to require re-learning from the ground up. I suggest that you take some time to work through a book like Accelerated C++, starting from the beginning without skipping anything.Quote:
Originally Posted by Yarlini Amirthanesan
When buying that book also buy a new keyboard. The one you have seem to have some broken keys...
It's not necessary to post all this personal contact information in every post. I don't think you should refer to your employer publicly unless you represent it officially which I doubt you do here.
Anyway note that new/delete isn't available in C. These are C++ operators.
C++ doesn't have the automatic memory management you find in other modern languages such as Java and C#. This makes C++ more flexible but it also puts an additional burden on the programmer who must make sure everything that's allocated on the heap gets properly deleted.
But there's relief to be had. A first simple step is to consider std::vector as an alternative to ordinary arrays. Then there are all the other containers in the standard library and the so called smart pointers like std::shared_ptr.
Honestly, I'd take the post with a pinch of salt. I wouldn't be surprised if the poster's actual intent was simply to make this "Yarlini Amirthanesan" look bad, preferably professionally...
I've never seen anyone online so eager to reveal their real identity and coordinates, unless they are actual professionals representing their company.
I didn't think of that. Maybe some admin here could drop a note at that email address? Hmm...Quote:
Originally Posted by monarch_dodra