What should malloc(0) do?
1061
What is meant by realloc()?
1090
What is typeof in c?
959
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 )
{
}
2621
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.
1634
Why do we use null pointer?
1003
What is a function in c?
1492
What are the differences between new and malloc in C?
1075
What happens if you free a pointer twice?
1029
Why c is called a middle level language?
1056
Is c high or low level?
968
Write a program for finding factorial of a number.
1035
Is it possible to initialize a variable at the time it was declared?
1178
Explain the ternary tree?
972
How can I open a file so that other programs can update it at the same time?
1134