Showing posts with label Character Functions. Show all posts
Showing posts with label Character Functions. Show all posts

Character and String functions

These functions are used for manipulating characters.
1. isalnum()
This functions carries out the test "Is the character alphanumeric?". An alphanumeric character is a letter of either lower or upper-case, or a digit. It has a prototype in the header file ctype.h. The argument to this function is a character represented as an integer.
The function isalnum() returns a non-zero value if the character is alphanumeric and zero if it is not so.
2. isdigit()
This function carries out the test "Is the character a digit?". It has a prototype in the header file ctype.h. The argument to this function is also characte represented as an integer.
The function isdigit() returns a non-zero value if the character is a digit and a zero if it is not so.
LEARN MORE >>

Single Character Functions

C++ supports many character-based input and output functions for reading and writing a character. These functions can read or write one character at a time. These functions are known as unformatted console I/O functions.
Getchar() and Putchar() Functions
The functions getchar() and putchar() are single character functions. The heeader file for these functions is stdio.h.
getchar()
The getchar() function reads a single character from the standard input device( keyboard). The getchar() waits for the character input until a charcter is typed at the keyboard. LEARN MORE>>