View previous topic :: View next topic
|
Author |
Message |
donateeye Warnings : 2 New User
Joined: 01 Jun 2007 Posts: 62 Location: chennai
|
|
|
|
Hi, Please let me know the following :
If I have the following alloactions made :
ALLOCATION (a)
ALLOCATION (b)
ALLOCATION (c)
all the above variables are based on the pointer X.
Now, I want to use the variable b, how to use it? should I free anything before using the variable b? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
What does your code look like? Do you have 3 separate ALLOCATE statements?
Each ALLOCATE statement acquires an area of storage and sets a pointer -in your case, x. ALLOCATE (b) will overwrite the pointer value set in x for ALLOCATE (a) and ALLOCATE (c) will overwrite the value set for (b).
If you are finished with a variable/structure you should release it before overwriting the pointer addressing it.
Garry. |
|
Back to top |
|
|
donateeye Warnings : 2 New User
Joined: 01 Jun 2007 Posts: 62 Location: chennai
|
|
|
|
Alright thanks Garry |
|
Back to top |
|
|
|