I need testPalindrome and removeSpace
#include
#define SIZE 256
/* function prototype */
/* test if the chars in the range of [left, right] of array
is a palindrome */
int testPalindrome( char array[], int left, int right );
/* remove the space in the src array and copy it over to the
"copy" array */
/* set the number of chars in the "copy" array to the
location that cnt points t */
void removeSpace(char src[], char copy[], int *cnt);
int main( void )
{
char c; /* temporarily holds keyboard input */
char string[ SIZE ]; /* original string */
char copy[ SIZE ]; /* copy of string without spaces */
int count = 0; /* length of string */
int copyCount; /* length of copy */
printf( "Enter a sentence:\n" );
/* get sentence to test from user */
while ( ( c = getchar() ) != '\n' && count < SIZE ) {
string[ count++ ] = c;
} /* end while */
string[ count ] = '\0'; /* terminate string */
/* make a copy of string without spaces */
removeSpace(string, copy, ©Count);
/* print whether or not the sentence is a palindrome */
if ( testPalindrome( copy, 0, copyCount - 1 ) ) {
printf( "\"%s\" is a palindrome\n", string );
} /* end if */
else {
printf( "\"%s\" is not a palindrome\n", string );
} /* end else */
return 0; /* indicate successful termination */
} /* end main */
void removeSpace(char src[], char copy[], int *cnt)
{
}
int testPalindrome( char array[], int left, int right )
{
}
2614
List some of the static data structures in C?
1156
What is a 'null pointer assignment' error?
1162
What is an array in c?
1001
What is the meaning of
?
990
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
1626
What should malloc(0) do?
1058
What is masking?
1102
how many types of operators are include in c language
a) 4
b) 6
c) 8
d) 12
1018
What is the purpose of void in c?
992
What is the use of a ‘ ’ character?
1027
What is the use of #include in c?
1036
what is the height of tree if leaf node is at level 3. please
explain
2088
Explain how can I convert a number to a string?
1100
What is array of structure in c?
1098