hummm, when I do the var* as a global it DOES work....bugger.
Heres what im actually doing: (I didnt post this because I didnt think it made a difference. Im still allocating to a var* either way, but obviously there is a difference if one way produces a compile error and the other doesn't)
<objects.h file>
typedef struct my_struct
{ STRING* str1;
var var1;
var var2;
var* my_array;
struct my_struct* next;
} my_struct;
my_struct* struct_ptr;
<main.c>
#include <default.c>;
#include <acknex.h>;
#include "objects.h";
function my_function_startup()
{ var count;
var my_array_size = 100;
struct_ptr = (my_struct*)malloc(sizeof(my_struct*));
struct_ptr->my_array = (var*)malloc(sizeof(var)*my_array_size);
count = 0;
while(count<my_array_size)
{ struct_ptr->my_array[count] = 0;
count += 1;
}
}
'struct_ptr->my_array[count] = 0;' of course produces the error.