🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4225

Declare array size at run time not compile time???Help??

#4225
From: Coder
Date: Sat, 14 Oct 1995 09:36
14 lines
1067 bytes
I want to use an array to create a 2d matrix and fill it with random data in a 
loop.  I want to give the user the option of changing the size of the array 
and looping that new one, filling it with random data.  Then I will compare 
the output of the two.  But I don't know what size the user will want the 
array to be.


int matrix[13][45]  first time
int matrix[2][10]  second time
int matrix[40][40] third time

how can I change the size while the program is running.  Using visual c++ 1.52 
I try to say matrix[x][y] but I need constants inside of the [ ] and I don't 
know of another approach, my books are not very helpful.
Technical Details
Message-ID: <coder.5.0048A737@neosoft.com>
Path: arc1-ca.pugleaf.net!uuneo.neosoft.com!CODER!coder

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!uuneo.neosoft.com!CODER!coder
From: coder@neosoft.com (Coder)
Newsgroups: comp.std.c
Subject: Declare array size at run time not compile time???Help??
Date: Sat, 14 Oct 1995 09:36:10 UNDEFINED
Organization: NeoSoft Internet Services   +1 713 968 5800
Message-ID: <coder.5.0048A737@neosoft.com>
NNTP-Posting-Host: sam-ppp-l4.neosoft.com
X-Newsreader: Trumpet for Windows [Version 1.0 Rev B final beta #1]