|
C Programming |
PROTOTYPE | FUNCTION DESCRIPTION |
int isdigit (intc) | Returns a true value if c is a digit, and 0 (false) otherwise. |
int isalpha (int c) | Returns a true value if c is a letter, and 0 otherwise. |
int isalnum (int c) | Returns a true value if c is a digit or a letter, and 0 otherwise. |
int isxdigit (int c) | Returns a true value if c is a hexadecimal digit character, and 0 otherwise. |
int islower (int c) | Returns a true value if c is a lowercase letter, and 0 otherwise. |
int isupper (int c) | Returns a true value if c is an uppercase letter, and 0 otherwise. |
int tolower (int c) | If c is an uppercase letter, tolower returns c as a lowercase letter. Otherwise, tolower returns the argument unchanged. |
int toupper (int c) | If c is a lowercase letter, toupper returns c as an uppercase letter. Otherwise, toupper returns the argument unchanged. |
int isspace (int c) | Returns a true value if c is a white-space character--newline
( ' \ n ' ), space ( ' ' ),
form feed ( ' \ f '), carriage return ( '\r ), horizontal tab ( ' \ t ' ), or vertical tab ( ' \ v ' ) -- and 0 otherwise. |
int iscntrl (int c) | Returns a true value if c is a control character, and 0 otherwise. |
int ispunct (int c) | Returns a true value if c is a printing character other than a space, a digit, or a letter, and 0 otherwise. |
int isprint (int c) | Returns a true value if c is a printing character including space ( ' ' ), and 0 otfherwise. |
int isgraph ( int c ) | Returns a true value if c is a printing character other than space ( ' ' ), and 0 otherwise. |
When using the following functions from the standard input/output library,
include the <stdio.h> header file.
int getchar (void) | Input the next character from the standard input and return it as an integer. |
char *gets (char *s) | Input characters from the standard input into the array s until a newline or end-of-file character is encountered. A terminating NULL character is appended to the array. |
int putchar (int c) | Print the character stored in c. |
int puts(const char *s) | Print the string s followed by a newline character. |
int sprintf(char *s, const char *format, ...) | Equivalent to printf except the output is stored in the array s instead of printing on the screen. |
int sscanf(char *s, const char *format, ...) | Equivalent to scanf except the input is read from the array s instead of reading from the keyboard. |
When using the following functions
from the string handling library,
include the <string.h> header
file.
char *strcpy (char *s1, const char *s2) | Copies the string s2 into the arrray s1. The value of s1 is returned. |
char *strncpy (char *s1, const char *s2, size_t n) | Copies at most n characters of the string s2 into the array s1. The value of s1 is returned. |
char *strcat (char *s1, const char *s2) | Appends the string s2 to the array s1. The first character of s2 overwrites the terminating NULL character of s1. The value of s1 is returned. |
char *strncat (char *s1, const char *s2, size_t n) | Appends at most n characters of string s2 to array s1.
The first character of s2 overwrites the terminating NULL character of s1. The value of s1 is returned. |
int strcmp (const char *s1, const char *s2) | Compares the string s1 to the string s2. The function returns 0, less than 0, or greater than 0 if s1 is equal to, less than, or greater than s2, respectively. |
int strncmp (const char *s1, const char
*s2,
size_t n) |
Compares up to n characters of the string s1 to the string s2. The function returns 0, less than 0, or greater than 0 if s1 is equal to, less than, or greater than s2, respectively. |
size_t strlen (const char *s) | Determines the length of string s. The number of characters preceding the terminating NULL character is returned. |
The next page will contain information about Structures, Unions, Bit Manipulations, Enumerations, and File Processing with the C language. There are many more subjects that could be covered, but due to lack of time and space they are not included in this web site.
If you have comments or suggestions, email me at MarliJordan@ispchannel.com
|