main()
{
FILE *fin;
char line[50];
char exp[SIZE];
fin=fopen("prefix.txt","r");
if(fin==NULL)
{
printf("\nFile Cannot be Opened\n");
}
else
{
printf("\nfile opened\n");
while(fgets(line, sizeof(line), fin)!=NULL)
{
sscanf(line, "%s", exp);
exp=delete_spaces(exp);
}
}
fclose(fin);
getch();
}
char delete_spaces(char a[])
{
int l,k=0,i=0;
l=strlen(a);
while(i<l)
{
if(a[i]==' ')
i++
else
a[k++]=a[i++];
}
return a;
}
After compiling this program I am getting error "Compatibility Type Error" In line containing "exp=delete_spaces(exp);" and I don't know how to remove it. Is there is some problem with array passing ?