A general answer is Yes. Heap data persists until you explicitly free it. Stack 
data "pops" when you return from a called routine.

That's a general answer. I don't know your specifics, and everything I know 
about pointers in COBOL could be engraved on the back of a postage stamp.

But in general, routine X can call routine Y passing a pointer variable. 
Routine Y can then allocate something on the heap (malloc or new) and place the 
address in the pointer variable. On return to X, the allocated area is (still) 
available to X.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Scott Ford
Sent: Monday, March 09, 2015 9:09 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: LE Question

I have a question about heaps. I want to have a Cobol program call a C routine, 
the C routine to place data onto the heap  then return back to Cobol. The 
question is can Cobol then reference that data ?

Regards,
Scott
www.identityforge.com

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to