Can someone please explain why this function will not compile.
#include <stdio.h>
#include <string.h>
#include <ctype.h>
// This function determines if a string is a palindrome.
/* This function reverses the characters in the string
* passed by the caller. */
void is_palindrome (char* string)
{
int i;
int length = strlen(string);
int half_way = length/2;
printf ("Function reverse called for string %s\n",
string);
for (i = 0; i < half_way; i++)
{
swap (&string[i], &string[length-1-i]);
}
}
int main(void)
{
char input[1000] = "";
printf ("Enter a message: ");
fgets(input, 1000, stdin);
input[999] = 0;
is_palindrome(input);
return 0;
}