pasar una estructura a array

Charly
16 de Diciembre del 2003
Hola.
Quiero pasar una estructura (struct algo ) a un array de tipo char para poderlo escribir tal cual a un fichero. He intentado lo siguiente:
char *buffer = (char*) malloc (tamanyoBuffer);
int i;
for (i=0;i&ltsizeof(laEstructura);i++)
buffer[i]= ((char)laEstructura[i]);

El compilador me dice:
fs.c:81: error: subscripted value is neither array nor pointer

¿me podríais echar una mano?
Un saludo