Why does everyone say not to use gets?
1105
Why do we use static in c?
1127
Is it possible to initialize a variable at the time it was declared?
1220
Write a program to find the biggest number of three numbers in c?
1045
What does c in a circle mean?
1077
How do you define a string?
1103
Explain how do you convert strings to numbers in c?
1080
What is the explanation for the dangling pointer in c?
1117
What is an identifier?
1034
Who invented bcpl language?
1194
What is the difference between the = symbol and == symbol?
1118
What is a static function in c?
1165
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 )
{
}
2681
What does malloc () calloc () realloc () free () do?
1063
Which is better pointer or array?
1028