Group,

 

I have tried pointers, created dynamic memory, and every conceivable
variation I could find or think of.  The problem seems to stem from arrays
have to be created with a constant.  Since I am reading the array size from
a file into a variable, the variable can not be a constant.  Pointers work
with a one dimensional array, but I can not get them to work with 2.

 

Thanks,

 

Michael J. Reaves, MCP

Database Administrator/Financial Coordinator

 

  _____  

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of
Brett W. McCoy
Sent: Wednesday, March 28, 2007 7:31 AM
To: [email protected]
Subject: Re: [c-prog] dynamic array

 

On 3/28/07, Michael Reaves <[EMAIL PROTECTED] <mailto:mreaves%40aidt.edu> edu>
wrote:

> I am trying to create a dynamic 2 dimensional array. I have to read in 2
> numbers from a file. These 2 numbers tell me what size array I need. How
> do I take these 2 numbers and create a dynamic 2 dimensional array? For
> example I read in 3 3 and need an array of points[3][3]. In the same file
> later I read in 4 4 and need the same array points[4][4]. All suggestions
> will be appreciated.

What have you tried so far? What language? This is easy in C++, not so
easy in C.

-- Brett
----------------------------------------------------------
"In the rhythm of music a secret is hidden;
If I were to divulge it, it would overturn the world."
-- Jelaleddin Rumi

 



[Non-text portions of this message have been removed]

Reply via email to