delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/12/04:46:56

Date: Wed, 11 Feb 98 22:37:50 PST
From: Noam Rotem <nrotem AT johnbryce DOT co DOT il>
Subject: Re: Dynamically declaring 2-d arrays
To: zager AT post DOT comstar DOT ru
Cc: djgpp AT delorie DOT com
Message-ID: <Chameleon.980211224106.nrotem@netvision.netvision>
MIME-Version: 1.0

--- On Tue, 10 Feb 1998 09:20:54 +0300  Dim Zegebart <zager AT post DOT comstar DOT ru> wrote:

>GCC has special feature which allows to declare arrays dynamically :
>int foo(ibt x,int y)
>{ int arr[x][y];
>  ...
>}
>That's all.
>Note, this is a specific gcc feature, so it's not portable to other
>compilers.

This sounds very odd... Can I then return arr and use it as every other dynamic 
allocation? What's the type of arr in this case? Can you explain how it is implemented by 
GCC?

TIA
---------------------------------------------
Noam Rotem
John Bryce Training Centre
Tel Aviv, Israel.
03-7535803
=============================================
1. Take upon yourself an impossible mission.
2. Accomplish the mission.
3. Go back to step 1.

It's the only sane answer to modern life.

---
11/02/98
22:37:50

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019