My Sponsors

Thursday, September 15, 2011

Pre-Defined C++ Functions (C++ Reserved Words0

cctype (ctype.h)
header
Character handling functions
This header declares a set of functions to classify and transform individual characters.

All these functions take as parameter the
int equivalent of one character and return an int, that can either be another character or a value representing a boolean value: an int value of 0 means false, and an int value different from 0 represents true.

There are two sets of functions:

First a set of classifying functions that check whether the character passed as parameter belongs to a certain category. These are:
Check if character is alphanumeric (function)

Check if character is alphabetic (function)

Check if character is a control character (function)

Check if character is decimal digit (function)

Check if character has graphical representation (function)

Check if character is lowercase letter (function)

Check if character is printable (function)

Check if character is a punctuation character (function)

Check if character is a white-space (function )

Check if character is uppercase letter (function)

Check if character is hexadecimal digit (function)

And secondly, two functions to convert between letter cases:
Convert uppercase letter to lowercase (function)

Convert lowercase letter to uppercase (function)

For the first set, here is a map of how the original 127-character ASCII set is considered by each function (an x indicates that the function returns true on that character)

cmath (math.h)
header
C numerics library
cmath declares a set of functions to compute common mathematical operations and transformations:

Trigonometric functions:
Compute cosine (function)

Compute sine (function)

Compute tangent (function)

Compute arc cosine (function)

Compute arc sine (function)

Compute arc tangent (function)

Compute arc tangent with two parameters (function)

Hyperbolic functions:
Compute hyperbolic cosine (function)

Compute hyperbolic sine (function)

Compute hyperbolic tangent (function)

Exponential and logarithmic functions:
Compute exponential function (function)

Get significand and exponent (function)

Generate number from significand and exponent (function)

Compute natural logarithm (function)

Compute common logarithm (function)

Break into fractional and integral parts (function)

Power functions
Raise to power (function)

Compute square root (function)

Rounding, absolute value and remainder functions:
Round up value (function)

Compute absolute value (function)

Round down value (function)

Compute remainder of division (function)
csignal (signal.h)
C library to handle signals
Some running environments use signals to inform running processes of certain events. These events may be related to errors performed by the program code, like a wrong arithmetical operation or to exceptional situations, such as a request to interrupt the program.

Signals generally represent situations where the program has either been requested to terminate or an unrecoverable error has happened, therefore handling a signal allows for either perform pre-termination cleanup operations or try to recover from the error in some way.

Not all running environments are required to generate automatic signals in the cases for which they are designed in the standard C library, and some other environments not only generate these but also many more specific signals. But in any case, all signals generated explicitly with a call to function raise are delivered to its corresponding signal handler.

The C header
signal.h includes the following functions:
Set function to handle signal (function )

Generates a signal (function)

It also declares the following type:
Integral type (type)

And several macro contant values: SIGABRT, SIGILL, SIGSEGV, SIG_DFL, SIG_IGN, SIGFPE, SIGINT, SIGTERM and SIG_ERROR (explained in signal).

cstdlib (stdlib.h)

header
C Standard General Utilities Library
This header defines several general purpose functions, including dynamic memory management, random number generation, communication with the environment, integer arthmetics, searching, sorting and converting.

Functions

String conversion:
Convert string to double (function)

Convert string to integer (function)

Convert string to long integer (function)

Convert string to double (function)

Convert string to long integer (function )

Convert string to unsigned long integer (function )

Pseudo-random sequence generation:
Generate random number (function)

Initialize random number generator (functions)

Dynamic memory management:
Allocate space for array in memory (function)

Deallocate space in memory (function)

Allocate memory block (function)

Reallocate memory block (function)

Environment:
Abort current process (function)

Set function to be executed on exit (function)

Terminate calling process (function)

Get environment string (function)

Execute system command (function )

Searching and sorting:
Binary search in array (function )

Sort elements of array (function)

Integer arithmethics:
Absolute value (function)

Integral division (function)

Absolute value (function)

Integral division (function)

Multibyte characters:
Get length of multibyte character (function)

Convert multibyte character to wide character (function)

Convert wide character to multibyte character (function)

Multibyte strings:
Convert multibyte string to wide-character string (function)

Convert wide-character string to multibyte string (function)

Macros

Failure termination code (macro)

Success termination code (macro)

Maximum size of multibyte characters (macro)

Null pointer (macro)

Maximum value returned by rand (macro)

Types

Integral division (function)

Integral division (function)

Unsigned integral type (type)

cstring (string.h)

header
C Strings
This header file defines several functions to manipulate C strings and arrays.

Functions

Copying:
Copy block of memory (function)

Move block of memory (function )

Copy string (function)

Copy characters from string (function)

Concatenation:
Concatenate strings (function)

Append characters from string (function)

Comparison:
Compare two blocks of memory (function)

Compare two strings (function )

Compare two strings using locale (function)

Compare characters of two strings (function)

Transform string using locale (function)

Searching:
Locate character in block of memory (function)

Locate first occurrence of character in string (function)

Get span until character in string (function)

Locate character in string (function)

Locate last occurrence of character in string (function)

Get span of character set in string (function)

Locate substring (function)

Split string into tokens (function)

Other:
Fill block of memory (function)

Get pointer to error message string (function)

Get string length (function )

Macros

Null pointer (macro)

Types

Unsigned integral type (type)

ctime (time.h)

header
C Time Library
This header file contains definitions of functions to get and manipulate date and time information.

Functions

Time manipulation
Clock program (function)

Return difference between two times (function)

Convert tm structure to time_t (function)

Get current time (function)

Conversion:
Convert tm structure to string (function)

Convert time_t value to string (function)

Convert time_t to tm as UTC time (function )

Convert time_t to tm as local time (function)

Format time to string (function)

Macros

Clock ticks per second (macro)

Null pointer (macro)

types

Clock type (type )

Unsigned integral type (type)

Time type (type)

Time structure (type)