Palindrome without Library functions
Posted on 2004-11-29
Hi I am new to programming and need to write a palindrome without using a main() or global variables, as well as no library functions. I have to have a ToUpper function that acts like the standard library function toupper (first checking that the given character is a lower case alphabetical character before performing a transformation). Then I need to write a string named ToUpperStr which converts all alphabetical characters of a given string to uppercase. (The function expects the original string and the resulting conversion overwrites the original string. The function returns a pointer of the resulting string). Next I must write a function named ReverseStr which reverses the string front to back. (The function expects the original string and the address to place the resulting string in that order. The function returns a pointer of the resulting string. Assume that the two blocks of memory don't over lap). Next I have to write a function named "CleanStr" which removes all characters which are not alphanumeric. The function expects the following parameters in the folowing order: original string, address to place the resulting string, address to place the length of the resulting string. (The function returns a pointer of the resulting string. Again assume no two blocks overlap). Next I must write a function named IsPalindrome which returns 1 if the given string is a palindrome and 0 if returns false. This function expects the string to be checked. This function must make use of the other functions specified. Also the function should assume that the maximum length of a given string is the #define'd const STRMAXLEN. This const should be defined in my header file as 80. Someother basic rules for this program are that the original string givin in any function should remain unchanged unless specifically stated in the requirments. Keyword const should be used appropriatly in all functions. Thank you very much to whom ever can help me.