while (i < maxentries)
{
// First allocate the memory needed.
speechbank[i] = (DIALOGUE*)malloc(sizeof(DIALOGUE);
speechbank[i].textstr = str_create("#128");
// Then you can read the data and store it in the array.
speechbank[i].opcode = file_var_read(filehandle);
speechbank[i].actor = file_var_read(filehandle);
file_str_read(filehandle,speechbank[i].textstr);
i++;
}