Palindrom and check for only lowercase letters

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • weaknessforcats
    replied
    Right you are. I didn't think of that.

    Leave a comment:


  • RedSon
    replied
    Originally posted by weaknessforcats
    Yes, you should not be posting code but since the OP needs a recursive function and your solution does not use one, I have let the code stand.
    Sorry w4c, I didn't see your post before I removed the code. Usually we do not allow code in any question that can be commonly found in programming assignments. So, even if the user needs a recursive solution and someone posts an iterative solution we still do not allow it because if 3rd user comes in and searches for "palindrome " they will have an iterative solution.

    OPs, I encourage you to post code snippets of critical areas of your code that you are questioning the logic in or wondering why it does not work. Generally posting code snippets will not get your code deleted, whereas posting entire code files will.

    Leave a comment:


  • weaknessforcats
    replied
    Yes, you should not be posting code but since the OP needs a recursive function and your solution does not use one, I have let the code stand.

    Leave a comment:


  • Simonius
    replied
    I know that we're not supposed to post code if they have no coding but I'm doing an exercise which starts with checking if the word's a palindrom.
    My coding works but I was wondering if there's a more effective way.

    For the ts: my reasoning for this solution was this:
    -for a palindrom the first and last letter, second and the letter before the last, ... must be the same.
    -a string is an array of characters so I could just compare them.

    Code:
    Sorry friend...
    And for the lower case take a look at the cctype library it contains the function you need for the lowercase ;)
    Last edited by RedSon; Feb 25 '08, 03:58 PM.

    Leave a comment:


  • Ganon11
    replied
    What do you have so far?

    Leave a comment:


  • TOE022
    started a topic Palindrom and check for only lowercase letters

    Palindrom and check for only lowercase letters

    Hi!

    can anyone help me with this task?

    im creating a palindrom :

    write a recursic function whitch takes a stringobject(wh o only contains small letters and numbers) and checks if its a palindrom..
Working...