Sep 27, 2014 at 6:14am
1. Why not just write cin>> str; instead of lines 27-30 inc?
2. Try also checkPalindrome( str ); at line 36?
:-)
Sep 27, 2014 at 6:32am
after doing that even the 5 character word is not working….. can tell what is wrong with my checkPalindrome code ?
Sep 27, 2014 at 6:43am
Show us your code. I am runningyour code successfully on codeblocks for all sorts of lengths including 5.
PS with the couple of small changes I suggested. (Of course.)
PPS I didn't check your function logic because it worked. I'm lazy. But if it aint broken ...
Last edited on Sep 27, 2014 at 6:46am
Sep 27, 2014 at 6:49am
Ohh yes its running fine ..!?!! thanks!
Sep 27, 2014 at 6:58am
is there some way so that i can prevent the users from writing more than they entered .That is
if i entered size 2,
I will still be able to write more than 2 characters and the function is checking all of them !
for eg:
size entered : 2;
str entered : abcddcba;
output : is
how can i prevent this …
Sep 27, 2014 at 8:17am
One way is to accept a full line of text by getline() or whatever and then check that the length of that input complies before proceeding ...
Last edited on Sep 27, 2014 at 8:18am