473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

dangling pointer

if we store some value at the place in memory which void pointer references then we increment void pointer this leads to dangling pointer?can any one explain whats the reasons for dangling pointer
Jun 21 '06 #1
1 4395
Banfa
9,065 Expert Mod 8TB
Not necessarily, it's only really dangling if the area of memory it now points to is not available for you to use and it's only dangerous if you then write to that location.

A dangling pointer is really a pointer that is pointing to some random piece of memory that the code in question has no right to access, for instance

Expand|Select|Wrap|Line Numbers
  1. int array[20];
  2. int *pI;
  3.  
  4. pI = array + 100;
  5.  
leaves pI dangling.
Jun 21 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Aravind | last post by:
I would like to know in what manner dangling pointers affect the security of a application developed using C++.What are the loopholes that are created by dangling pointers and how they could be...
11
by: John | last post by:
Hi: Below is a simple code: class link1 { public: link1(); link1(int &b1, double &b2); int* a1;
20
by: __PPS__ | last post by:
Hello everybody in a quiz I had a question about dangling pointer: "What a dangling pointer is and the danger of using it" My answer was: "dangling pointer is a pointer that points to some...
5
by: Richard | last post by:
My experience has always been that you're SOL when trying to safely detect and stop references to dangling memory (non-null pointers to free'ed blocks) at runtime (C99, Linux). Maybe somebody...
5
by: madhusagar79 | last post by:
I got one issue to find the Dangling Pointer. Is there any way to find the Dangling Pointer?
3
by: shivapadma | last post by:
1.when referenced pointer is not active then it is called dangling pointer. is this correct ? 2.the pointer which does not point to anything is called null pointer. is NULL macro is a...
3
by: gsuresh | last post by:
what is dangling pointer?can i get one example?
3
by: sreenadh494 | last post by:
what is dangling pointer, how it ishappen in program, what isthe solution
1
by: sridhard2406 | last post by:
Hi All, I have a doubt on undrestanding Dangling pointers.Below I mentioned sample code. please let me know, my view on Dangling pointers is correct or not? main( ) ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.