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
What is include directive in c?
1092
How can you determine the maximum value that a numeric variable can hold?
1151
Under what circumstances does a name clash occur?
1157
Which is more efficient, a switch statement or an if else chain?
969
what type of questions arrive in interview over c programming?
1982
What is operator promotion?
1012
Hi can anyone tell what is a start up code?
2000
how many types of operators are include in c language
a) 4
b) 6
c) 8
d) 12
1018
What is the difference between test design and test case
design?
2030
Explain what are bus errors, memory faults, and core dumps?
1223
Is it valid to address one element beyond the end of an array?
1121
How can you invoke another program from within a C program?
1023
How can I recover the file name given an open stream or file descriptor?
1030
Explain how can you avoid including a header more than once?
1041