by Dinesh Thakur Category: Function and Pointer

The syntax of the function is as follows:

size_t strftime(char* s, size_t maxsize, const char* format, const struct tm * Tmptr);

 
by Dinesh Thakur Category: Function and Pointer

We may make use of typedef for declaring pointers to functions. Examine the following code:

typedef void(*PF) ();

 
by Dinesh Thakur Category: Function and Pointer

We know that the C language uses the call by value mechanism to pass parameters and that a function parameter is a copy of the argument specified in the function call.

 
by Dinesh Thakur Category: Function and Pointer

Strings are character arrays terminated by null character. Pointer to a single string may be declared in the same way as the pointer to a one-dimensional array.

 
by Dinesh Thakur Category: Function and Pointer

The function prototype of ctime () is written in the following manner:

char *ctime( const time_t *Timeptr);

 
by Dinesh Thakur Category: Function and Pointer

Passing Arguments by Value

The arguments to a function may be passed on by value or by pointers. In the first case the copies of values of parameters are passed on to the function. The function can only manipulate these copies. So, the original values of parameters are not affected. Their values cannot be changed by the function because function does not know where the parameters are stored in the memory. For example, if the function simply swapped the values of its parameters, it is only swapping the copies of the values of parameters. The original values of parameters are not affected. In Program, the arguments are passed on to the function by values. These values are changed by the function and then an expression is evaluated. The function may be called any numbers of times, the output of the program as well as the data fed to function do not change. This is the benefit of passing the arguments by value.

 
by Dinesh Thakur Category: Function and Pointer

The function localtime () converts the calendar time, i.e., the output of function time (), into a broken-down time expressed as local time, and returns the pointer to broken-down time. If the conversion into local time fails, the function returns NULL pointer. The prototype of the function is written in the following manner:

 

Page 8 of 8



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles