Avoiding memory leaks in C

0 votes
I'm looking for some general tips on making sure that I don't leak memory in my C++ codes. Like which dynamically allocated memory should get free when and other best practices regarding the same?
Nov 5, 2018 in Others by Bharani
• 4,660 points
1,198 views

1 answer to this question.

0 votes

If you use smart pointers at all places where it could be applicable, you wouldn't have to worry about managing memory manually. Plus, smart pointers are now available as a C++ standard version called C++11. You should definitely check these out: Boost lib, TR1, and smart pointers.

answered Nov 5, 2018 by nirvana
• 3,130 points

Related Questions In Others

0 votes
1 answer

Easiest way to convert int to string in C++

The C++11 version has introduced the std::stoi ...READ MORE

answered Feb 10, 2022 in Others by Rahul
• 9,670 points
328 views
0 votes
1 answer

Convert char to int in C and C++

In order to read the value as ...READ MORE

answered Feb 17, 2022 in Others by Aditya
• 7,680 points
3,426 views
0 votes
0 answers

How do I determine the size of my array in C?

How do I determine the size of ...READ MORE

May 1, 2022 in Others by Kichu
• 19,050 points
242 views
0 votes
0 answers

What exactly is \r in C language?

This the code: #include <stdio.h> int main() { int ...READ MORE

May 9, 2022 in Others by Kichu
• 19,050 points
276 views
0 votes
0 answers

What is the best way to use a HashMap in C++?

Can someone recommend me some good documentation ...READ MORE

May 19, 2022 in Others by Kichu
• 19,050 points
281 views
0 votes
1 answer

setuptools: build shared libary from C++ code, then build Cython wrapper linked to shared libary

There is a seemingly undocumented feature of setup that ...READ MORE

answered Sep 11, 2018 in Python by Priyaj
• 58,090 points
498 views
0 votes
1 answer

Python : Short Integers

Firstly, if you're doing any sort of ...READ MORE

answered Sep 18, 2018 in IoT (Internet of Things) by Annie97
• 2,160 points
2,195 views
0 votes
1 answer

setuptools: build shared libary from C++ code, then build Cython wrapper linked to shared libary

There is a seemingly undocumented feature of setup that ...READ MORE

answered Sep 21, 2018 in Python by Priyaj
• 58,090 points
2,145 views
0 votes
1 answer

How to pass large records to map/reduce tasks?

Hadoop is not designed for records about ...READ MORE

answered Sep 25, 2018 in Big Data Hadoop by Frankie
• 9,830 points
1,221 views
0 votes
1 answer

Events & Threading in Windows Forms

I don't think you should be updating ...READ MORE

answered Nov 10, 2018 in Others by nirvana
• 3,130 points
728 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP