
456 Data Structures Using C
token[0] =’\0’;
ch= ‘’;
get_token(infile,token, &ch, &flag);
/* Check if it is a number appearing at the
beginning of a line or as argument of
goto statement */
if ((isdigit (token [0]) && ch1 ==’\n’ ) || (isdigit (token [0]) &&
(!strcmp(last_token, “goto”))) )
{ temp = atoi(token);
temp = temp + offset;
itoa(temp,token,10);
}
writeout(outfile,token,ch);
ch1 = ch;
strcpy(last_token ,token);
}
fclose(infile);
fclose(outfile);
} /* end of main */
void get_token(FILE * infile, char token[30], char *break_pt, int *flag)
{int i;
char ch;
i = -1;
while (!(*flag))
{ ch = fgetc(infile); ...