Error in my program cant figure out where i went wrong

I'm new to this programming thing and not very good at it. I'm trying to write this palindrome program and i got 1 error but i cant figure out where i went wrong. can anybody help me and tell me where i went wrong and if this program will work?




#include<stdio.h>

void reverse( const char * const sPtr ); /* protype */

int main (void)
{

char phrase[80]; /* create char array */
int i;

for (i = 0; i<=80; i++)
{
printf("Please character %d",&i+1);
scanf("%c",&phrase[i]);
}


printf("Please enter a phrase or sentence: \n");

gets( phrase ); /* reads line of text entered */

printf("\nThe line printed backwards is: \n");
reverse(phrase);

return 0; /* indicates successful termination */

}

void reverse( const char * const sPtr )

{

if ( sPtr[0]=='\0')

{

printf("Is a Palindrome \n");

return;

}

else

{

reverse( &sPtr[1] );

putchar( sPtr[0] );

}/* end else */

} /* terminates function reverse */

{
if

{

isPalindrome [phrase] == [reverse] != null;

return Is a Palindrome;

}

else

{

printf("Is NOT a Palindrome \n");

}
}

{

printf("Please enter another phrase or enter quit to terminate this program \n")

}


This code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
if

{

isPalindrome [phrase] == [reverse] != null;

return Is a Palindrome;

}

else

{

printf("Is NOT a Palindrome \n");

}
}

{

printf("Please enter another phrase or enter quit to terminate this program \n")

}


is not doing anything because it isn't inside a function or the main function.

You need to figure out how to get that into the main function or the reverse function somehow.

These lines are what is causing the errors.
Thats the thing i'm totally stomped

do you thing i should declear

bool ispalindrome (char phrase)?
I'm not really sure what this program is trying to do, so I cannot offer much help. Just try to get the code I posted above into a function properly.

If your new to programming I would start off with something a little simpler. If this is homework, ask your teacher about it.
Topic archived. No new replies allowed.