C Standard Library - Quick Guide

The assert.h header file of the C Standard Library provides a macro called assert which can be used to verify assumptions made by the program and print a diagnostic message if this assumption is false.
The defined macro assert refers  to another macro NDEBUG which is not a part of <assert.h>. If NDEBUG is defined as a macro name in the source file, at the point where <assert.h> is included, the assert macro is defined as follows −
#define assert(ignore) ((void)0)
Following is the only function defined in the header assert.h −
This is actually a macro and not a function, which can be used to add diagnostics in your C program.
The ctype.h header file of the C Standard Library declares several functions that are useful for testing and mapping characters.
All the functions accepts int as a parameter, whose value must be EOF or representable as an unsigned char.
All the functions return non-zero (true) if the argument c satisfies the condition described, and zero(false) if not.
Following are the functions defined in the header ctype.h −
This function checks whether the passed character is alphanumeric.
This function checks whether the passed character is alphabetic.
This function checks whether the passed character is control character.
This function checks whether the passed character is  decimal digit.
This function checks whether the passed character has graphical representation using locale.
This function checks whether the passed character is  lowercase letter.
This function checks whether the passed character is printable.
This function checks whether the passed character is a punctuation character.
This function checks whether the passed character is white-space.
This function checks whether the passed character is an uppercase letter.
This function checks whether the passed character is a hexadecimal digit.
The library also contains two conversion functions that accepts and returns an "int".
This function converts uppercase letters to lowercase.
This function converts lowercase letters to uppercase.
Digits
This is a set of whole numbers { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }.
Hexadecimal digits
This is the set of { 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f }.
Lowercase letters
This is a set of lowercase letters { a b c d e f g h i j k l m n o p q r s t u v w x y z }.
Uppercase letters
This is a set of uppercase letters {A B C D E F G H I J K L M N O P Q R S T U V W X Y Z }.
Letters
This is a set of lowercase and uppercase letters.
Alphanumeric characters
This is a set of Digits, Lowercase letters and Uppercase letters.
Punctuation characters
This is a set of ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
Graphical characters
This is a set of Alphanumeric characters and Punctuation characters.
Space characters
This is a set of  tab, newline, vertical tab, form feed, carriage return, and space.
Printable characters
This is a set of Alphanumeric characters, Punctuation characters and Space characters.
Control characters
In ASCII, these characters have octal codes 000 through 037, and 177 (DEL).
Blank characters
These are spaces and tabs.
Alphabetic characters
This is a set of Lowercase letters and Uppercase letters.
The errno.h header file of the C Standard Library defines the integer variable errno, which is set by system calls and some library functions in the event of an error to indicate what went wrong. This macro expands to a modifiable lvalue of type int, therefore it can be both read and modified by a program.
The errno is set to zero at program startup. Certain functions of the standard C library modify its value to other than zero to signal some types of error. You can also modify its value or reset to zero at your convenience.
The errno.h header file also defines a list of macros indicating different error codes, which will expand to integer constant expressions with type int.
Following are the macros defined in the header errno.h −
This is the macro set by system calls and some library functions in the event of an error to indicate what went wrong.
This macro represents a domain error, which occurs if an input argument is outside the domain, over which the mathematical function is defined and errno is set to EDOM.
This macro represents a range error, which occurs if an input argument is outside the range, over which the mathematical function is defined and errno is set to ERANGE.
The float.h header file of the C Standard Library contains a set of various platform-dependent constants related to floating point values. These constants are proposed by ANSI C. They allow making more portable programs. Before checking all the constants, it is good to understand that floating-point number is composed of following four elements −
S
sign ( +/- )
b
base or radix of the exponent representation, 2 for binary, 10 for decimal, 16 for hexadecimal, and so on...
e
exponent, an integer between a minimum emin and a maximum emax.
p
precision, the number of base-b digits in the significand.
Based on the above 4 components, a floating point will have its value as follows −
floating-point = ( S ) p x be

or

floating-point = (+/-) precision x baseexponent

The following values are implementation-specific and defined with the #define directive, but these values may not be any lower than what is given here. Note that in all instances FLT refers to type float, DBL refers to double, and LDBL refers to long double.
FLT_ROUNDS
Defines the rounding mode for floating point addition and it can have any of the following values −
-1 − indeterminable
0 − towards zero
1 − to nearest
2 − towards positive infinity
3 − towards negative infinity
FLT_RADIX 2
This defines the base radix representation of the exponent. A base-2 is binary, base-10 is the normal decimal representation, base-16 is Hex.
FLT_MANT_DIG
DBL_MANT_DIG
LDBL_MANT_DIG
These macros define the number of digits in the number (in the FLT_RADIX base).
FLT_DIG 6
DBL_DIG 10
LDBL_DIG 10
These macros define the maximum number decimal digits (base-10) that can be represented without change after rounding.
FLT_MIN_EXP
DBL_MIN_EXP
LDBL_MIN_EXP
These macros define the minimum negative integer value for an exponent in base FLT_RADIX.
FLT_MIN_10_EXP -37
DBL_MIN_10_EXP -37
LDBL_MIN_10_EXP -37
These macros define the minimum negative integer value for an exponent in base 10.
FLT_MAX_EXP
DBL_MAX_EXP
LDBL_MAX_EXP
These macros define the maximum integer value for an exponent in base FLT_RADIX.
FLT_MAX_10_EXP +37
DBL_MAX_10_EXP +37
LDBL_MAX_10_EXP +37
These macros define the maximum integer value for an exponent in base 10.
FLT_MAX 1E+37
DBL_MAX 1E+37
LDBL_MAX 1E+37
These macros define the maximum finite floating-point value.
FLT_EPSILON 1E-5
DBL_EPSILON 1E-9
LDBL_EPSILON 1E-9
These macros define the least significant digit representable.
FLT_MIN 1E-37
DBL_MIN 1E-37
LDBL_MIN 1E-37
These macros define the minimum floating-point values.
The following example shows the usage of few of the constants defined in float.h file.
#include <stdio.h>
#include <float.h>

int main () {
   printf("The maximum value of float = %.10e\n", FLT_MAX);
   printf("The minimum value of float = %.10e\n", FLT_MIN);

   printf("The number of digits in the number = %.10e\n", FLT_MANT_DIG);
}
Let us compile and run the above program that will produce the following result −
The maximum value of float = 3.4028234664e+38
The minimum value of float = 1.1754943508e-38
The number of digits in the number = 7.2996655210e-312

The limits.h header determines various properties of the various variable types. The macros defined in this header, limits the values of various variable types like char, int and long.
These limits specify that a variable cannot store any value beyond these limits, for example an unsigned character can store up to a maximum value of 255.
The following values are implementation-specific and defined with the #define directive, but these values may not be any lower than what is given here.
The following example shows the usage of few of the constants defined in limits.h file.
#include <stdio.h>
#include <limits.h>

int main() {

   printf("The number of bits in a byte %d\n", CHAR_BIT);

   printf("The minimum value of SIGNED CHAR = %d\n", SCHAR_MIN);
   printf("The maximum value of SIGNED CHAR = %d\n", SCHAR_MAX);
   printf("The maximum value of UNSIGNED CHAR = %d\n", UCHAR_MAX);

   printf("The minimum value of SHORT INT = %d\n", SHRT_MIN);
   printf("The maximum value of SHORT INT = %d\n", SHRT_MAX); 

   printf("The minimum value of INT = %d\n", INT_MIN);
   printf("The maximum value of INT = %d\n", INT_MAX);

   printf("The minimum value of CHAR = %d\n", CHAR_MIN);
   printf("The maximum value of CHAR = %d\n", CHAR_MAX);

   printf("The minimum value of LONG = %ld\n", LONG_MIN);
   printf("The maximum value of LONG = %ld\n", LONG_MAX);
  
   return(0);
}
Let us compile and run the above program that will produce the following result −
The maximum value of UNSIGNED CHAR = 255                                    
The minimum value of SHORT INT = -32768                                     
The maximum value of SHORT INT = 32767                                      
The minimum value of INT = -2147483648                                      
The maximum value of INT = 2147483647                                       
The minimum value of CHAR = -128                                            
The maximum value of CHAR = 127                                             
The minimum value of LONG = -9223372036854775808                            
The maximum value of LONG = 9223372036854775807

The locale.h header defines the location specific settings, such as date formats and currency symbols. You will find several macros defined along with an important structure struct lconv and two important functions listed below.
Following are the macros defined in the header and these macros will be used in two functions listed below −
LC_ALL
Sets everything.
LC_COLLATE
Affects strcoll and strxfrm functions.
LC_CTYPE
Affects all character functions.
LC_MONETARY
Affects the monetary information provided by localeconv function.
LC_NUMERIC
Affects decimal-point formatting and the information provided by localeconv function.
LC_TIME
Affects the strftime function.
Following are the functions defined in the header locale.h −
Sets or reads location dependent information.
Sets or reads location dependent information.
typedef struct {
   char *decimal_point;
   char *thousands_sep;
   char *grouping;	
   char *int_curr_symbol;
   char *currency_symbol;
   char *mon_decimal_point;
   char *mon_thousands_sep;
   char *mon_grouping;
   char *positive_sign;
   char *negative_sign;
   char int_frac_digits;
   char frac_digits;
   char p_cs_precedes;
   char p_sep_by_space;
   char n_cs_precedes;
   char n_sep_by_space;
   char p_sign_posn;
   char n_sign_posn;
} lconv
Following is the description of each of the fields −
decimal_point
Decimal point character used for non-monetary values.
thousands_sep
Thousands place separator character used for non-monetary values.
grouping
A string that indicates the size of each group of digits in non-monetary quantities. Each character represents an integer value, which designates the number of digits in the current group. A value of 0 means that the previous value is to be used for the rest of the groups.
int_curr_symbol
It is a string of the international currency symbols used. The first three characters are those specified by ISO 4217:1987 and the fourth is the character, which separates the currency symbol from the monetary quantity.
currency_symbol
The local symbol used for currency.
mon_decimal_point
The decimal point character used for monetary values.
mon_thousands_sep
The thousands place grouping character used for monetary values.
mon_grouping
A string whose elements defines the size of the grouping of digits in monetary values. Each character represents an integer value which designates the number of digits in the current group. A value of 0 means that the previous value is to be used for the rest of the groups.
positive_sign
The character used for positive monetary values.
negative_sign
The character used for negative monetary values.
int_frac_digits
Number of digits to show after the decimal point in international monetary values.
frac_digits
Number of digits to show after the decimal point in monetary values.
p_cs_precedes
If equals to 1, then the currency_symbol appears before a positive monetary value. If equals to 0, then the currency_symbol appears after a positive monetary value.
p_sep_by_space
If equals to 1, then the currency_symbol is separated by a space from a positive monetary value. If equals to 0, then there is no space between the currency_symbol and a positive monetary value.
n_cs_precedes
If equals to 1, then the currency_symbol precedes a negative monetary value. If equals to 0, then the currency_symbol succeeds a negative monetary value.
n_sep_by_space
If equals to 1, then the currency_symbol is separated by a space from a negative monetary value. If equals to 0, then there is no space between the currency_symbol and a negative monetary value.
p_sign_posn
Represents the position of the positive_sign in a positive monetary value.
n_sign_posn
Represents the position of the negative_sign in a negative monetary value.
The following values are used for p_sign_posn and n_sign_posn −
The math.h header defines various mathematical functions and one macro. All the functions available in this library take double as an argument and return double as the result.
There is only one macro defined in this library −
HUGE_VAL
This macro is used when the result of a function may not be representable as a floating point number. If magnitude of the correct result is too large to be represented, the function sets errno to ERANGE to indicate a range error, and returns a particular, very large value named by the macro HUGE_VAL or its negation (- HUGE_VAL).
If the magnitude of the result is too small, a value of zero is returned instead. In this case, errno might or might not be set to ERANGE.
Following are the functions defined in the header math.h −
Returns the arc cosine of x in radians.
Returns the arc sine of x in radians.
Returns the arc tangent of x in radians.
Returns the arc tangent in radians of y/x based on the signs of both values to determine the correct quadrant.
Returns the cosine of a radian angle x.
Returns the hyperbolic cosine of x.
Returns the sine of a radian angle x.
Returns the hyperbolic sine of x.
Returns the hyperbolic tangent of x.
Returns the value of e raised to the xth power.
The returned value is the mantissa and the integer pointed to by exponent is the exponent. The resultant value is x = mantissa * 2 ^ exponent.
Returns x multiplied by 2 raised to the power of exponent.
Returns the natural logarithm (base-e logarithm) of x.
Returns the common logarithm (base-10 logarithm) of x.
The returned value is the fraction component (part after the decimal), and sets integer to the integer component.
Returns x raised to the power of y.
Returns the square root of x.
Returns the smallest integer value greater than or equal to x.
Returns the absolute value of x.
Returns the largest integer value less than or equal to x.
Returns the remainder of x divided by y.
The setjmp.h header defines the macro setjmp(), one function longjmp(), and one variable type jmp_buf, for bypassing the normal function call and return discipline.
Following is the variable type defined in the header setjmp.h −
jmp_buf
This is an array type used for holding information for macro setjmp() and function longjmp().
There is only one macro defined in this library −
This macro saves the current environment into the variable environment for later use by the function longjmp(). If this macro returns directly from the macro invocation, it returns zero but if it returns from a longjmp() function call, then a non-zero value is returned.
Following is the only one function defined in the header setjmp.h −
This function restores the environment saved by the most recent call to setjmp() macro in the same invocation of the program with the corresponding jmp_buf argument.
The signal.h header defines a variable type sig_atomic_t, two function calls, and several macros to handle different signals reported during a program's execution.
Following is the variable type defined in the header signal.h −
sig_atomic_t
This is of int type and is used as a variable in a signal handler. This is an integral type of an object that can be accessed as an atomic entity, even in the presence of asynchronous signals.
Following are the macros defined in the header signal.h and these macros will be used in two functions listed below. The SIG_ macros are used with the signal function to define signal functions.
SIG_DFL
Default signal handler.
SIG_ERR
Represents a signal error.
SIG_IGN
Signal ignore.
The SIG macros are used to represent a signal number in the following conditions −
SIGABRT
Abnormal program termination.
SIGFPE
Floating-point error like division by zero.
SIGILL
Illegal operation.
SIGINT
Interrupt signal such as ctrl-C.
SIGSEGV
Invalid access to storage like segment violation.
SIGTERM
Termination request.
Following are the functions defined in the header signal.h −
This function sets a function to handle signal i.e. a signal handler.
This function causes signal sig to be generated. The sig argument is compatible with the SIG macros.
The stdarg.h header defines a variable type va_list and three macros which can be used to get the arguments in a function when the number of arguments are not known i.e. variable number of arguments.
A function of variable arguments is defined with the ellipsis (,...) at the end of the parameter list.
Following is the variable type defined in the header stdarg.h −
va_list
This is a type suitable for holding information needed by the three macros va_start(), va_arg() and va_end().
Following are the macros defined in the header stdarg.h −
This macro initializes ap variable to be used with the va_arg and va_end macros. The last_arg is the last known fixed argument being passed to the function i.e. the argument before the ellipsis.
This macro retrieves the next argument in the parameter list of the function with type type.
This macro allows a function with variable arguments which used the va_start macro to return. If va_end is not called before returning from the function, the result is undefined.
The stddef.h header defines various variable types and macros. Many of these definitions also appear in other headers.
Following are the variable types defined in the header stddef.h −
ptrdiff_t
This is the signed integral type and is the result of subtracting two pointers.
size_t
This is the unsigned integral type and is the result of the sizeof keyword.
wchar_t
This is an integral type of the size of a wide character constant.
Following are the macros defined in the header stddef.h −
This macro is the value of a null pointer constant.
This results in a constant integer of type size_t which is the offset in bytes of a structure member from the beginning of the structure. The member is given by member-designator, and the name of the structure is given in type.
The stdio.h header defines three variable types, several macros, and various functions for performing input and output.
Following are the variable types defined in the header stdio.h −
size_t
This is the unsigned integral type and is the result of the sizeof keyword.
FILE
This is an object type suitable for storing information for a file stream.
fpos_t
This is an object type suitable for storing any position in a file.
Following are the macros defined in the header stdio.h −
NULL
This macro is the value of a null pointer constant.
_IOFBF, _IOLBF and  _IONBF
These are the macros which expand to integral constant expressions with distinct values and suitable for the use as third argument to the setvbuf function.
BUFSIZ
This macro is an integer, which represents the size of the buffer used by the setbuf function.
EOF
This macro is a negative integer, which indicates that the end-of-file has been reached.
FOPEN_MAX
This macro is an integer, which represents the maximum number of files that the system can guarantee to be opened simultaneously.
FILENAME_MAX
This macro is an integer, which represents the longest length of a char array suitable for holding the longest possible filename. If the implementation imposes no limit, then this value should be the recommended maximum value.
L_tmpnam
This macro is an integer, which represents the longest length of a char array suitable for holding the longest possible temporary filename created by the tmpnam function.
SEEK_CUR, SEEK_END, and SEEK_SET
These macros are used in the fseek function to locate different positions in a file.
TMP_MAX
This macro is the maximum number of unique filenames that the function tmpnam can generate.
stderr, stdin, and stdout
These macros are pointers to FILE types which correspond to the standard error, standard input, and standard output streams.
Following are the functions defined in the header stdio.h −
Closes the stream. All buffers are flushed.
Clears the end-of-file and error indicators for the given stream.
Tests the end-of-file indicator for the given stream.
Tests the error indicator for the given stream.
Flushes the output buffer of a stream.
Gets the current file position of the stream and writes it to pos.
Opens the filename pointed to by filename using the given mode.
Reads data from the given stream into the array pointed to by ptr.
Associates a new filename with the given open stream and same time closing the old file in stream.
Sets the file position of the stream to the given offset. The argument offset signifies the number of bytes to seek from the given whence position.
Sets the file position of the given stream to the given position. The argument pos is a position given by the function fgetpos.
Returns the current file position of the given stream.
Writes data from the array pointed to by ptr to the given stream.
Deletes the given filename so that it is no longer accessible.
Causes the filename referred to, by old_filename to be changed to new_filename.
Sets the file position to the beginning of the file of the given stream.
Defines how a stream should be buffered.
Another function to define how a stream should be buffered.
Creates a temporary file in binary update mode (wb+).
Generates and returns a valid temporary filename which does not exist.
Sends formatted output to a stream.
Sends formatted output to stdout.
Sends formatted output to a string.
Sends formatted output to a stream using an argument list.
Sends formatted output to stdout using an argument list.
Sends formatted output to a string using an argument list.
Reads formatted input from a stream.
Reads formatted input from stdin.
Reads formatted input from a string.
Gets the next character (an unsigned char) from the specified stream and advances the position indicator for the stream.
Reads a line from the specified stream and stores it into the string pointed to by str. It stops when either (n-1) characters are read, the newline character is read, or the end-of-file is reached, whichever comes first.
Writes a character (an unsigned char) specified by the argument char to the specified stream and advances the position indicator for the stream.
Writes a string to the specified stream up to but not including the null character.
Gets the next character (an unsigned char) from the specified stream and advances the position indicator for the stream.
Gets a character (an unsigned char) from stdin.
Reads a line from stdin and stores it into the string pointed to by, str. It stops when either the newline character is read or when the end-of-file is reached, whichever comes first.
Writes a character (an unsigned char) specified by the argument char to the specified stream and advances the position indicator for the stream.
Writes a character (an unsigned char) specified by the argument char to stdout.
Writes a string to stdout up to but not including the null character. A newline character is appended to the output.
Pushes the character char (an unsigned char) onto the specified stream so that the next character is read.
Prints a descriptive error message to stderr. First the string str is printed followed by a colon and then a space.
The stdlib.h header defines four variable types, several macros, and various functions for performing general functions.
Following are the variable types defined in the header stdlib.h −
size_t
This is the unsigned integral type and is the result of the sizeof keyword.
wchar_t
This is an integer type of the size of a wide character constant.
div_t
This is the structure returned by the div function.
ldiv_t
This is the structure returned by the ldiv function.
Following are the macros defined in the header stdlib.h −
NULL
This macro is the value of a null pointer constant.
EXIT_FAILURE
This is the value for the exit function to return in case of failure.
EXIT_SUCCESS
This is the value for the exit function to return in case of success.
RAND_MAX
This macro is the maximum value returned by the rand function.
MB_CUR_MAX
This macro is the maximum number of bytes in a multi-byte character set which cannot be larger than MB_LEN_MAX.
Following are the functions defined in the header stlib.h −
Converts the string pointed to, by the argument str to a floating-point number (type double).
Converts the string pointed to, by the argument str to an integer (type int).
Converts the string pointed to, by the argument str to a long integer (type long int).
Converts the string pointed to, by the argument str to a floating-point number (type double).
Converts the string pointed to, by the argument str to a long integer (type long int).
Converts the string pointed to, by the argument str to an unsigned long integer (type unsigned long int).
Allocates the requested memory and returns a pointer to it.
Deallocates the memory previously allocated by a call to calloc, malloc, or realloc.
Allocates the requested memory and returns a pointer to it.
Attempts to resize the memory block pointed to by ptr that was previously allocated with a call to malloc or calloc.
Causes an abnormal program termination.
Causes the specified function func to be called when the program terminates normally.
Causes the program to terminate normally.
Searches for the environment string pointed to by name and returns the associated value to the string.
The command specified by string is passed to the host environment to be executed by the command processor.
Performs a binary search.
Sorts an array.
Returns the absolute value of x.
Divides numer (numerator) by denom (denominator).
Returns the absolute value of x.
Divides numer (numerator) by denom (denominator).
Returns a pseudo-random number in the range of 0 to RAND_MAX.
This function seeds the random number generator used by the function rand.
Returns the length of a multibyte character pointed to by the argument str.
Converts the string of multibyte characters pointed to by the argument str to the array pointed to by pwcs.
Examines the multibyte character pointed to by the argument str.
Converts the codes stored in the array pwcs to multibyte characters and stores them in the string str.
Examines the code which corresponds to a multibyte character given by the argument wchar.
The string.h header defines one variable type, one macro, and various functions for manipulating arrays of characters.
Following is the variable type defined in the header string.h −
size_t
This is the unsigned integral type and is the result of the sizeof keyword.
Following is the macro defined in the header string.h −
NULL
This macro is the value of a null pointer constant.
Following are the functions defined in the header string.h −
Searches for the first occurrence of the character c (an unsigned char) in the first n bytes of the string pointed to, by the argument str.
Compares the first n bytes of str1 and str2.
Copies n characters from src to dest.
Another function to copy n characters from str2 to str1.
Copies the character c (an unsigned char) to the first n characters of the string pointed to, by the argument str.
Appends the string pointed to, by src to the end of the string pointed to by dest.
Appends the string pointed to, by src to the end of the string pointed to, by dest up to n characters long.
Searches for the first occurrence of the character c (an unsigned char) in the string pointed to, by the argument str.
Compares the string pointed to, by str1 to the string pointed to by str2.
Compares at most the first n bytes of str1 and str2.
Compares string str1 to str2. The result is dependent on the LC_COLLATE setting of the location.
Copies the string pointed to, by src to dest.
Copies up to n characters from the string pointed to, by src to dest.
Calculates the length of the initial segment of str1 which consists entirely of characters not in str2.
Searches an internal array for the error number errnum and returns a pointer to an error message string.
Computes the length of the string str up to but not including the terminating null character.
Finds the first character in the string str1 that matches any character specified in str2.
Searches for the last occurrence of the character c (an unsigned char) in the string pointed to by the argument str.
Calculates the length of the initial segment of str1 which consists entirely of characters in str2.
Finds the first occurrence of the entire string needle (not including the terminating null character) which appears in the string haystack.
Breaks string str into a series of tokens separated by delim.
Transforms the first n characters of the string src into current locale and places them in the string dest.
The time.h header defines four variable types, two macro and various functions for manipulating date and time.
Following are the variable types defined in the header time.h −
size_t
This is the unsigned integral type and is the result of the sizeof keyword.
clock_t
This is a type suitable for storing the processor time.
time_t is
This is a type suitable for storing the calendar time.
struct tm
This is a structure used to hold the time and date.
The tm structure has the following definition −
struct tm {
   int tm_sec;         /* seconds,  range 0 to 59          */
   int tm_min;         /* minutes, range 0 to 59           */
   int tm_hour;        /* hours, range 0 to 23             */
   int tm_mday;        /* day of the month, range 1 to 31  */
   int tm_mon;         /* month, range 0 to 11             */
   int tm_year;        /* The number of years since 1900   */
   int tm_wday;        /* day of the week, range 0 to 6    */
   int tm_yday;        /* day in the year, range 0 to 365  */
   int tm_isdst;       /* daylight saving time             */
};
Following are the macros defined in the header time.h −
NULL
This macro is the value of a null pointer constant.
CLOCKS_PER_SEC
This macro represents the number of processor clocks per second.
Following are the functions defined in the header time.h −
Returns a pointer to a string which represents the day and time of the structure timeptr.
Returns the processor clock time used since the beginning of an implementation defined era (normally the beginning of the program).
Returns a string representing the localtime based on the argument timer.
Returns the difference of seconds between time1 and time2 (time1-time2).
The value of timer is broken up into the structure tm and expressed in Coordinated Universal Time (UTC) also known as Greenwich Mean Time (GMT).
The value of timer is broken up into the structure tm and expressed in the local time zone.
Converts the structure pointed to by timeptr into a time_t value according to the local time zone.
Formats the time represented in the structure timeptr according to the formatting rules defined in format and stored into str.
Calculates the current calender time and encodes it into time_t format.

    12 Lectures 
     2 hours 

 Nishant Malik

    12 Lectures 
     2.5 hours 

 Nishant Malik

    48 Lectures 
     6.5 hours 

 Asif Hussain

    12 Lectures 
     2 hours 

 Richa Maheshwari

    20 Lectures 
     3.5 hours 

 Vandana Annavaram

    44 Lectures 
     1 hours 

 Amit Diwan
 Print
 Add Notes
 Bookmark this page