struct_ptr = (my_struct*)malloc(sizeof(my_struct)); - I still get the error message this way

struct_ptr = (my_struct)malloc(sizeof(my_struct)); - gives me compile time error 'cannot convert pointer to struct my_struct'

struct_ptr = (my_struct*)malloc(sizeof(my_struct*)); - this line works fine, it lets me assign a string to str1 by struct_ptr->str1 = str_create("hello world") and lets me assign numbers to var1 & var2 by struct_ptr->var1 = 1;, etc.

Im allocating space for the structure, but I cant seem to allocate an array for struct_ptr->my_array.