What does ctype h actually define
- character classification and conversion
The header file
|Function in ||Function in ||description|
Tests whether a character is an alphanumeric character.
Tests whether a character is a letter.
Tests whether a character is a control character (e.g. (Ctrl) + (B)).
Tests whether a character is a decimal digit.
Tests whether a character is a printable character.
Tests whether a character is a lowercase letter.
Tests whether a character is a printable character, but not a space.
Tests whether a character is a punctuation mark.
Tests whether a character is a space (space character).
Tests whether a character is an uppercase letter.
int iswxdigit (wint_t wc);
Tests whether a character is a hexadecimal digit.
The isascii macro checks whether the character c is a standardized character from the ASCII character set (0–127). If not, it can be converted with toascii.
If c is a space, 1 is returned, otherwise 0 (only available with ANSI-C99 compilers).
Converts uppercase to lowercase letters.
Converts lowercase to uppercase.
toascii is a macro that limits the transferred value c (by deleting all bits except the 7 least significant) to the range 0 to 127 and returns the result of this operation. However, this means that national characters such as 'ä', 'ü', 'ö' ... are displayed incorrectly.
All functions in the table expect an int or wint_t argument, the value of which must be representable as EOF (or WEOF) or unsigned char or wchar_t. If successful, these functions return a value other than 0. If an error occurs, the return value is always 0.
Apart from the isdigit () and iswdigit () functions, the result depends on the setting of the local environment for the LC_CTYPE category. You can query and change this environment with setlocale () (see Section 20.5, »
The header file
These functions allow you to perform at least the same tests as in Table 20.1. All you have to do is leave out the isw prefix for property. Thus, a check for a wide character wc is equivalent to the tests in the comment after it:
The advantage of this implementation is obvious. It is easy to define additional strings for property that are required for certain locale-specific characters.
Just as there are functions for classifying wide characters, there are also functions for converting wide characters. The syntax of these functions is:
You can use the strings tolower and toupper for property. Thus, a conversion for a wide character wc is equivalent to the conversion in the comment after it:
A listing that uses normal byte-oriented characters now follows to demonstrate the individual functions:
You can use this code to convert any letter in a text file to an upper, lower case, or ASCII character.
How did you like the Openbook? We always look forward to your feedback. Please send us your feedback as an e-mail to [email protected]
- How big is the iTunes catalog
- Does software or hardware develop faster?
- Everyone gets a hostel at TISS
- What is Volume H.
- What is the cutoff of IOCL
- How does science explain miracles
- How often do you eat sweets
- How does economic production affect capitalism
- How is Bangladesh represented in Pakistani textbooks
- Should I join Zomato?
- Why is my phone's battery running out of power?
- Who is Eddie Murphy's girlfriend
- Are Delhi pubs safe for girls
- What Are Some Beginner Epoxy Brands
- How long does a pet allergy last?
- Should I twist my nose piercing?
- How efficient is the blockchain currency
- How can I buy French wine
- Could the Hittite language be revived
- Is a dancer playing sport
- Which film has the most hypnotic scene
- Is India safe for tourists in 2019
- What does cuvee mean in wines
- Will virtual reality replace television
- What are intelligent transmitters
- What is a procreation
- ArcGIS can be replaced by open source products
- Law firms will pay for law school
- Why is LGBT so taboo in India
- Which batteries do garage remote controls need
- Is mathematics derived from the abstract Platonic reality
- How do I remember and learn faster
- What is your mind 3
- Which Acura is like a Honda Accord