strange error in c program with gcc
sir my program is comparing data in two files and my program is executed in windows and when i am compiled it gives error like
"/tmp/ccVFUQap.
collect2: ld returned 1 exit status"
sir i did not know what is this error please tell me what should i do and my code is given below
#include<stdio.h>
#include<stdlib.h>
main()
{
FILE *f,*f2;
static int flag;
char c,c2,fil[
printf("ENTER FIRST FILE NAME\n");
scanf("%s",fil);
printf("ENTER SECOND FILE NAME\n");
scanf("%s",fil2);
f=fopen(fil,"r");
f2=fopen(fil2,"r");
if(f==NULL|
{
printf("INVALID FILE NAME\n");
exit(0);
}
c=getc(f);
c2=getc(f2);
while(c!
{
if(c!=c2)
{
flag++;
break;
}
c=getc(f);
c2=getc(f2);
}
fclose(f);
fclose(f2);
if(flag==1)
printf("THE TWO FILES ARE NOT EQUAL\n");
else
printf("THE TWO FIELS ARE EQUAL\n");
}
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Eliah Kagan
- Solved:
- Last query:
- Last reply: