C library <ctype.h> header functions

Driving innovation in embedded systems, IoT, and FPGA/SOC development. Delivering cutting-edge solutions, expert technical services, and empowering the tech community.
Search for a command to run...

Driving innovation in embedded systems, IoT, and FPGA/SOC development. Delivering cutting-edge solutions, expert technical services, and empowering the tech community.
No comments yet. Be the first to comment.
In MATLAB, ans is a special variable that automatically stores the result of expressions or function calls that are not assigned to any variable. It's a handy feature for quickly checking results or performing calculations on the fly in the Command W...

Using the toupper() function in C The toupper() function in C is used to convert a lowercase character to its uppercase counterpart. For example, the toupper() function would convert the character 'a' to 'A'. The toupper() function takes a character ...

Using the isxdigit() function in C The isxdigit() function in C is used to check whether a character is a hexadecimal digit (0-9,a-f,A-F). The function takes a character as input and returns a non-zero value if the character is a hexadecimal digit, o...

Using the isspace() function in C The isspace() function in C is used to check whether a character is a space. The function takes a character as input and returns a non-zero value if the character is a space, or zero if the character is not a space. ...

The <ctype.h> header file in the C programming language provides several functions to test and manipulate characters. Here are some of the most commonly used functions that are present in C Library ctype_h file:
| Functions | Description |
| isalpha() | Checks if the passed character is alphabetic. Returns a non-zero value if c is an alphabet, else returns 0. |
| isdigit() | Checks if the passed character is a digit. Returns a non-zero value if c is a digit, else returns 0. |
| isalnum() | Checks if the passed character is alphanumeric. Returns non-zero value if c is an alphanumeric character, else returns 0. |
| isspace() | Checks if the passed character is white-space. Returns a non-zero value if c is a white-space character, else returns 0. |
| islower() | Checks if the passed character is lowercase. Returns a non-zero value if c is a lowercase character, else returns 0. |
| isupper() | Checks if the passed character is uppercase. Returns non-zero value if c is an uppercase character, else returns 0. |
| isxdigit() | Checks if the passed character is a hexadecimal digit. Returns non-zero value if c is a hexadecimal digit, else returns 0. |
| iscntrl() | Checks if the passed character is a control character. Returns a non-zero value if c is a control character, else returns 0. |
| isprint() | Checks if the passed character is printable. Returns a non-zero value if c is a printable character, else returns 0. |
| ispunct() | Checks if the passed character is punctuation. Returns non-zero value if c is a punctuation character, else returns 0. |
| isgraph() | Checks if the passed character has a graphical representation using locale. Returns a non-zero value if c has a graphical representation, else returns 0. |
| toupper() | Converts lowercase letters to uppercase. Returns the uppercase equivalent to letters, if such value exists, else letters remain unchanged. The character’s value must be representable as an unsigned char or the value of EOF. |
| tolower() | Converts uppercase letters to lowercase. Returns the lowercase equivalent to the letters, if such value exists, else letters remain unchanged. The character’s value must be representable as an unsigned char or the value of EOF. |