|
-
March 1st, 2009, 12:15 AM
#6
Re: realloc() : invalid pointer ?
 Originally Posted by creeping death
i willingly set i till 20 because i wanted to see if i'd get any runtime errors because i have deallocated those memory locations...
i dont get any errors.
That is because accessing memory that has been deallocated is undefined behaviour. This means that anything can happen -- work all the time, crash all the time, work some of the time and crash other times, work at 12:00 on Tuesday and fail at 5:00 PM on a Wednesday, etc...
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|