[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Determine if variable has been freed

Posted on 2009-04-27
2
Medium Priority
?
277 Views
Last Modified: 2012-05-06
How can I determine if a variable has had its memory freed?
0
Comment
Question by:collages
2 Comments
 
LVL 19

Accepted Solution

by:
erikTsomik earned 2000 total points
ID: 24242095
take a look at this post.

http://www.experts-exchange.com/Programming/Languages/C/Q_21932996.html
And i think the best way to check is to print the variable
0
 
LVL 40

Expert Comment

by:evilrix
ID: 24242119
>> How can I determine if a variable has had its memory freed?
There is no portable way to do this... it is best practice to always set a pointer to NULL (or 0) once the memory it points to has been freed.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question