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
796 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 in Others by Rahul
• 8,980 points
28 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 in Others by Aditya
• 7,280 points
294 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 in Others by Kichu
• 19,040 points
22 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 in Others by Kichu
• 19,040 points
19 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 in Others by Kichu
• 19,040 points
15 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,080 points
190 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
957 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,080 points
1,369 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
787 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
296 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP