g.c:12: warning: passing argument 1 of 'fgets' from incompatible pointer type
g.c:12: error: too few arguments to function 'fgets'
g.c:14: error: 'sc' undeclared (first use in this function)
g.c:14: error: (Each undeclared identifier is reported only once
g.c:14: error: for each function it appears in.)
#include <stdio.h>
#include <string.h>
main()
{
FILE *myfileptr;
char * fgets ( char * sc, int num, FILE * words );
myfileptr=fopen("words","r");
// gets() should be fgets. Please read the link posted for the function
while((myfileptr=fgets(myfileptr))!=EOF)
{
if(sc)
printf("%s",sc);
printf("EOF\n");
if(strlen(sc)%2==0) printf("Word not palindrom");
else
{
int i;
for(i = 0; i < strlen(sc); i += 1)
if(sc[i] != sc[strlen(sc) - 1 - i])
{
printf("Word not palindrom");
break;
}
if(i==strlen(sc)) printf("The word is palindrom");
}
}
}