C Reference function gmtime()

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 | Comments Off on C Reference function gmtime()


C Reference function ctime()

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 | Comments Off on C Reference function ctime()


C Reference function asctime()

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 | 1 Comment


(ANSI) C Reference: Using stdarg.h for Variable Arguments Handling

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 | Comments Off on (ANSI) C Reference: Using stdarg.h for Variable Arguments Handling


C Reference String Operation: strrchr()

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 | 2 Comments


C Reference String Operation: strncpy()

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 | Comments Off on C Reference String Operation: strncpy()


C Reference String Operation: strncmp()

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 | 2 Comments


C Reference String Operation: strncat()

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 | Comments Off on C Reference String Operation: strncat()


C Reference String Operation: strlen()

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 | Comments Off on C Reference String Operation: strlen()


C Reference String Operation: strcpy()

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 | Comments Off on C Reference String Operation: strcpy()