From: | Jack York |
Date: | 12 Aug 2000 at 21:20:41 |
Subject: | Passing a ptr |
Hello,
I would like to move some code for generating an array to its own
function. The code in question is shown below.
void main (void)
{
typdef struct
{
TEXT name[10];
} Array;
Array **array;
if (array = (mystruct **) AllocVec ( arraysize * sizeof (mystruct)))
{
for (i = 0; i < arraysize; i++)
{
if ( ! (array[i] = (mystruct) AllocVec (sizeof (mystruct)))
break;
}
It works fine as is but I when I place it in a function and call that
function, it doesn't work at all. I know it is how I am declaring
the args but I can't figure it out. Given a funtion name of
Makearray I tried MakeArray (mystruct **array) but it didn't
like that at all. Can someone show me the correct way of passing
the variable array?
Jack