#include “dict.h”
int writedict(const char *dictname, struct dict_elem *elist){
int j;
FILE *outf;
if ((outf = fopen(dictname, “w”)) == NULL){
return ERROR;
}
//cculate length of the aray
for (j = 0; elist[j].d_length != 0; j++)
;
//write out list of dict_elem structures
if (fwrite((void*)elist, sizeof(struct dict_elem), j, outf)