Saturday, May 22, 2010

C++ (palindrome strings?)?

i'm tring to write a program in c++ (with recursive function named test palindrome)to return true if the string is palindrome


else


return false

C++ (palindrome strings?)?
what have you used to learn C++? Because i think that "C++ Programming: Program Design Including Data Structures, Third Edition By: D.S. Malik


is a pretty good book it should explain your problem... What are you using to compile it?
Reply:In addition, look at the string class in the stl libraries. It can really help you with manipulating a string as an array.





Other things to consider:


1) Will punctuation or capitalization screw up your comparisons? look at the tolower and isalpha functions.





2) What do you do about spacing? 'A man, a plan a canal, panama' is a palindrome.


No comments:

Post a Comment