•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 455,964 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,630 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 476 | Replies: 2
![]() |
•
•
•
•
I have a palindrome program.Is there a way to ensure user input terminated in a string by a punctuation mark (e.g. ‘!’, ‘.’, or ‘?’.) in an array?
Get the length or the string, check the last character with the function
ispunct()
Copy the input line to a temp line. Use
isalpha() to check if the character is a letter and copy only letters. If you want letters and numbers, use alnum() . This will exclude all non-palindrome characters.Last thing, make sure when you do the copy you convert all the letters to upper or lower case (use
toupper() or tolower() ). This is because 'A' != 'a' Age is unimportant -- except in cheese
![]() |
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
Other Threads in the C Forum
- Previous Thread: the number of times a word appears in a sentence(c prog)
- Next Thread: IO problem...



Linear Mode