change this
FILE *inp, *outp;
inp = fopen("E:reservat.txt", "r");
if(inp == NULL)
{
printf("Cannot open the file ");
exit(1);
}
for(i = 0; i < MAX; i++)
reserved[i] = 0;
n = 0;
for
(
int status = fscanf(inp, "%s", first[n]);
status != EOF;
status = fscanf(inp, "%s", first[n])
)
{
to
this
FILE *inp, *outp;
int status;
inp = fopen("E:reservat.txt", "r");
if(inp == NULL)
{
printf("Cannot open the file ");
exit(1);
}
for(i = 0; i < MAX; i++)
reserved[i] = 0;
n = 0;
for
(
status = fscanf(inp, "%s", first[n]);
status != EOF;
status = fscanf(inp, "%s", first[n])
)
{
The reason is you can't declare variables everywhere in C like in C++. All the variables in C must be declared at the beginning of a block before any other C statements.