I get this error when I try to compile following C program
#include <stdio.h>
#include <strings.h>
#define LEN 80
int main(void)
{
int mess[LEN], flag = 1;
int first = 0, last = 0;
printf("Enter a message: ");
gets(mess);
if (strlen(mess) > LEN)
{
printf("Out of memory\n");
return 2;
}
else
last = strlen(mess) - 1;
while (first <= last)
{
if ( mess[first] != mess[last] )
{
flag = 0;
}
first++;
last--;
}
if (flag == 1)
{
printf("Message is palindrom\n");
}
else
printf("Message isn't palindorm\n");
return 0;
}
When I run source through lint then I get following messages.
$ cc 2a.c -o 2a
"2a.c", line 23: warning: argument #1 is incompatible with prototype:
prototype: pointer to char : "/usr/include/iso/stdio_iso.h", line 226
argument : pointer to int
"2a.c", line 25: warning: argument #1 is incompatible with prototype:
prototype: pointer to const char : "/usr/include/iso/string_iso.h", line 63
argument : pointer to int
"2a.c", line 31: warning: argument #1 is incompatible with prototype:
prototype: pointer to const char : "/usr/include/iso/string_iso.h", line 63
argument : pointer to int
Thanks for helping