ANSI C Ctype Library
The mikroC PRO for 8051 provides a set of standard ANSI C library functions for testing and mapping characters.
Important :
- Not all of the standard functions have been included.
- The functions have been mostly implemented according to the ANSI C standard, but certain functions have been modified in order to facilitate 8051 programming. Be sure to skim through the description before using standard C functions.
Library Functions
isalnum
| Prototype |
unsigned short isalnum(char character); |
|---|---|
| Description |
Function returns 1 if the |
| Example |
res = isalnum('o'); // returns 1
res = isalnum('\r'); // returns 0
|
isalpha
| Prototype |
unsigned short isalpha(char character); |
|---|---|
| Description |
Function returns 1 if the |
| Example |
res = isalpha('A'); // returns 1
res = isalpha('1'); // returns 0
|
iscntrl
| Prototype |
unsigned short iscntrl(char character); |
|---|---|
| Description |
Function returns 1 if the |
| Example |
res = iscntrl('\r'); // returns 1
res = iscntrl('o'); // returns 0
|
isdigit
| Prototype |
unsigned short isdigit(char character); |
|---|---|
| Description |
Function returns 1 if the |
| Example |
res = isdigit('1'); // returns 1
res = isdigit('o'); // returns 0
|
isgraph
| Prototype |
unsigned short isgraph(char character); |
|---|---|
| Description |
Function returns 1 if the |
| Example |
res = isgraph('o'); // returns 1
res = isgraph(' '); // returns 0
|
islower
| Prototype |
int islower(char character); |
|---|---|
| Description |
Function returns 1 if the |
| Example |
res = islower('0'); // returns 1
res = islower('A'); // returns 0
|
ispunct
| Prototype |
unsigned short ispunct(char character); |
|---|---|
| Description |
Function returns 1 if the |
| Example |
res = ispunct('.'); // returns 1
res = ispunct('1'); // returns 0
|
isspace
| Prototype |
unsigned short isspace(char character); |
|---|---|
| Description |
Function returns 1 if the |
| Example |
res = isspace(' '); // returns 1
res = isspace('1'); // returns 0
|
isupper
| Prototype |
unsigned short isupper(char character); |
|---|---|
| Description |
Function returns 1 if the |
| Example |
res = isupper('A'); // returns 1
res = isupper('a'); // returns 0
|
isxdigit
| Prototype |
unsigned short isxdigit(char character); |
|---|---|
| Description |
Function returns 1 if the |
| Example |
res = isxdigit('A'); // returns 1
res = isxdigit('P'); // returns 0
|
toupper
| Prototype |
unsigned short toupper(char character); |
|---|---|
| Description |
If the |
| Example |
res = toupper('a'); // returns A
res = toupper('B'); // returns B
|
tolower
| Prototype |
unsigned short tolower(char character); |
|---|---|
| Description |
If the |
| Example |
res = tolower('A'); // returns a
res = tolower('b'); // returns b
|
What do you think about this topic ? Send us feedback!



