This is a discussion on To make Dangling pointer within the C and C++ forums, part of the Programming Talk category; I have a portion of extract of my code as below struct node *test(int inp) { struct node *t; t = (...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
To make Dangling pointer
I have a portion of extract of my code as below
struct node *test(int inp) { struct node *t; t = (struct node *) malloc(sizeof(struct node)); ......... ........ return t; } I want to make the pointer t as dangling pointer .Someone suggests me a way for achieving this. |
|
|||
|
It is not essential or mandatory that your program should crash if you have used dangling pointers. But you would get program crash if you use automatic variables in that memory defined in your C program and try to use that after usage of dangling pointers in your program. Make a try in this way and you would see your program crash.
|
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) | Steve Summit | Tech FAQ | 0 | 06-15-2004 07:00 AM |
| comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) | Steve Summit | Tech FAQ | 0 | 06-01-2004 07:01 AM |
| comp.lang.c Answers to Frequently Asked Questions (FAQ List) | Steve Summit | Tech FAQ | 0 | 06-01-2004 07:00 AM |
| comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) | Steve Summit | Tech FAQ | 0 | 05-15-2004 07:00 AM |
| Solaris x86 FAQ 2/2 | Dan Anderson | Tech FAQ | 0 | 04-27-2004 08:24 PM |