hi everyone :)
what i'm trying to do is to check if word in a string has numbers in it
for example:
if i enter string of one word "he11o"
i want to show error message that says
"One or more characters are numeric! Please re-enter the word!"
and if every character is alphabetic i want to let program continue working(this is just a small part of my overall program.) i have no idea how to check each character, please help.
i'm working in DevC++ 4.9.9.2 if that matters
my overall program is about converting NOUN words to PLURALS
i have everything done! this is the only part i cant find solution to :(
Taras20
0
Newbie Poster
Recommended Answers
Jump to PostYou've got
if (isalnum(word[i]))
, which basically means if word[i] is either a letter of the alphabet or numeric, you're failing it.
What you want to do is contained in Moschops reply. Check whetherisalpha(word[i])
is false.
Also, when you get the new word on failure, you're not resettingi
and …
All 3 Replies
Moschops
683
Practically a Master Poster
Featured Poster
Taras20
0
Newbie Poster
nullptr
167
Occasional Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.