What are the advantages of Macro over function?
1590
Is anything faster than c?
759
Where are c variables stored in memory?
788
What is meant by gets in c?
799
process by which one bit patten in to another by bit wise
operation is?
(a) masking,
(b) pruning,
(c) biting,
(d) chopping,
2133
When should volatile modifier be used?
737
Do variables need to be initialized?
802
What is infinite loop?
832
What is meant by inheritance?
834
Did c have any year 2000 problems?
870
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 )
{
}
2432
What is null pointer constant?
769
How variables are declared in c?
771
Is javascript based on c?
782
What is extern c used for?
748