Is it possible to use malloc() to allocate an array at run time?

I tried the following and it just plain doesnt work:

var my_array_size = 100;
var** my_array;

function my_function_startup()
{ var count;
// allocate the array
my_array = (var**)malloc(sizeof(var)*my_array_size);
// initialize all array indexs to 0.
count = 0;
while(count<my_array_size)
{ my_array[count] = 0;
count += 1;
}
}

I get a compile error on 'my_array[count] = 0;' - 'subscript requires an array or pointer type' - in other words, my_array isnt being allocated i think?

ive also tried 'my_array = (var**)malloc(sizeof(var*)*my_array_size);' and that doesnt do me any good either.