Is there a method that already exist that i can use to find if in an input there are alphabets or symbols eg $, # but not operators eg /,+,-. If there are alphabets and symbols it must return me true else false.

My problem is that i want to do a calculator prog. And before any calculation i want to verify if the string entered by the user is valid or not.

>Is there a method that already exist that i can use to find if in an input
>there are alphabets or symbols eg $, # but not operators eg /,+,-.
No, that's specialized behavior. However, the functions in ctype.h will go a long way toward writing your own. The ones you probably want are isalpha and ispunct, but for a calculator program you may need isalnum and isdigit. Probably isxdigit too if you plan on handling hexadecimal values.

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.