Jump to content

Talk:Variable-length array

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Loadmaster (talk | contribs) at 20:19, 23 October 2008 (stored where?: Depends on the implementation and language). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

stored where?

i think it is only on stack. but there might be cases where it is on heap due to size or just language way of dealing with ADT's. i ask for i added that it is typycally on stack onto main page. 84.16.123.194 (talk) 20:01, 23 October 2008 (UTC)[reply]

Depends on the language and implementation. In C (C99), it's on the stack, i.e., VLAs can only have auto storage class. In COBOL, it's either the WORKING-STORAGE or FILE SECTIONs, which are static data areas, or in the LINKAGE SECTION, which may be static to another program module or allocated on the heap (e.g., using EXEC CICS GETMAIN). — Loadmaster (talk) 20:19, 23 October 2008 (UTC)[reply]