Isalpha and isalnum

Source: Internet
Author: User

When I write a C-language identifier for a few days, I see someone else'sCodeThere are isalpha and isalnum, which saves a lot of trouble compared to my code. Baidu only knows that there are already ready-made functions available.

Both functions are included in # include <ctype. h>, where int isalpha (INT ch) is used to determine whether ch is a English letter, when it is an English letter A-Z or A-Z, in standard C is equivalent to using isupper (CH) (determine whether ch is a capital letter) | islower (CH) (determine whether ch is a lowercase letter) returns a non-zero value; otherwise, return zero;

Int isalnum (int c) is similar to int isalpha, but it has a wider scope of judgment and can also determine 0-9 numbers, that is, when it is an English letter A-Z or A-Z or 0-9, it returns a non-zero value, otherwise it returns zero;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.