Usage of gmtime():
struct tm * gmtime ( const time_t * ptr_time);
Parameters:
The pointer ptr_time is a pointer to a time_t object that contains a calendar time.
Calendar time is the number of seconds that have elapsed since EPOCH, which is 00:00:00, January 1, 1970 Universal Coordinate Time (UTC)
Return Value:
More »
Posted in C Reference time.h Functions |
Usage of ctime():
char * ctime ( const time_t * ptr_time );
Parameters:
Pointer ptr_time to a time_t object that contains a calendar time.
Return Value:
The function returns a C string containing the date and time information.
More »
Posted in C Reference time.h Functions |
Usage of asctime():
char * asctime ( const struct tm * ptr_time );
Parameters:
ptr_time is a pointer to a tm structure which in turn contains a calendar time.
Return Value:
The function returns a C string containing the date and time information.
The string is followed by a new-line character (‘\n’) and the terminating null-character. More »
Posted in C Reference time.h Functions |
There are cases where a function needs to accept varying numbers of arguments of varying type. For this we can use the macros defined in the header file stdarg.h. In this header file (stdarg.h) there macros defined that can be used to access the arguments of a list of unnamed (arguments with no corresponding parameter declarations) arguments.
There is one type described in stdarg.h: More »
Posted in C Reference stdarg.h Functions |
The function strrchr() returns a pointer to the last occurrence of x in a string.
Usage:
char *strrchr( const *str, int x);
Note: NULL will be returned if x isn’t found. More »
Posted in C Reference string.h Functions |
The function strncpy() copies up to n characters of one string to another string.
Usage:
char * strncpy( char * target, const char *source, size_t count); More »
Posted in C Reference string.h Functions |
The function strncmp() compares one string with another string up-to n characters.
Usage:
int strncmp( const char * target, const char * source, size_t count); More »
Posted in C Reference string.h Functions |
The strncat() function concatenates up to n characters of one string onto the end of another string.
Usage:
char *strncat(char *target, const char * source, size_t count); More »
Posted in C Reference string.h Functions |
The strlen() function returns the length of a string.
The length is determined by the number of characters before the null termination.
Usage:
size_t strlen(char *str)
strlen() source code example:
More »
Posted in C Reference string.h Functions |
The function strcpy() copies the characters from one string to another string.
Note: the null termination is also copied.
Usage:
char * strcpy( char *target, const char *source); More »
Posted in C Reference string.h Functions |