How to solve segmentation error in c
#include <stdio.h> #include <stdlib.h> #include <string.h> void main() { FILE *fint, *ftab, *flen, *fsym; int op1[10], textlen, textlen1, i, j = 0, len; char add[5], symadd[5], op[5], start[10], temp[30], line[20], label[20], mne[10], operand[10], symtab[10], opmne[10]; fint = fopen("input.txt", "r"); flen = fopen("length.txt", "r"); ftab = fopen("optab.txt", "r"); fsym = fopen("symtab.txt", "r"); fscanf(fint, "%s%s%s%s", add, label, mne, operand); if (strcmp(mne, "START") == 0) { strcpy(start, operand); fscanf(flen, "%d", &len); } printf("H^%s^%s^%d\nT^00%s^", label, start, len, start); fscanf(fint, "%s%s%s%s", add, label, mne, operand); while (strcmp(mne, "END") != 0) { fscanf(ftab, "%s%s", opmne, op); while (!feof(ftab)) { if (strcmp(mne, opmne) == 0) { fclose(ftab); fscanf(fsym, "%s%s", symadd, symtab); while (!feof(fsym))