by Dinesh Thakur Category: Function and Pointer

The function time () returns the current calendar time, i.e., the number of seconds elapsed since 00:00:00 hour January 1, 1970 GMT (or gmt are used alternatively) up to the execution of the function. The function prototype is written as follows:

 
by Dinesh Thakur Category: Function and Pointer

The atoi, atof and atol utility functions are used to perform string to numeric conversion. As indicated by the last letter in function names, these functions convert the argument string to an integer, floating and long number. Note that the argument string should contain a number of appropriate type as text, optionally preceded by whitespace. For example, the atof function can successfully convert strings such as" 1.23", "3.21El0", etc. The conversion stops when an inappropriate character is encountered in the input string. Thus, these functions will also be able to convert strings such as "-1. 23ABC", "3. 21E10ABc". If conversion is successful, these functions return the converted value, otherwise zero.

 
by Dinesh Thakur Category: Function and Pointer

The assignment operator (=) may be used on pointers of the same type. However, if the types of pointers (types of variables to which they point) are not same then we will have to do type casting of one of these to the type of the other to use assignment operator. However, the void pointer (void * ) can represent any pointer type. Thus, any type of pointer may be assigned to a void pointer. However, the reverse is not valid. A void pointer cannot be assigned to any other type of pointer without first converting the void pointer to that type.

 
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

Given a function f(x) which is continuous in the interval [a, b] and satisfying the property hat f(a)*f(b) < 0, there exists a root of the function f(x) in the interval [a, b]. The bisection algorithm works as follows where t: and 8 are small values specified by the user.

 
by Dinesh Thakur Category: Function and Pointer

The typedef may be used in declaration of a number of pointers of the same type. It does not change the type, it only creates a synonym, i.e., another name for the same type as illustrated below.

 
by Dinesh Thakur Category: Function and Pointer

The prototype of the function is written as given below,

time_t mktime (struct tm * Timeptr) ;

 
by Dinesh Thakur Category: Function and Pointer

The qualifier inline has been introduced in C-99 in order to achieve better compatibility between C and C++. If a small function needs to be called a large number of times in a program, the overburden of function call can make the program inefficient. Also, if the function code is put in the listing of the program wherever it is needed, it will not only make the program lengthy but also clumsy. With qualifier inline we need to define the function only once and the compiler substitutes the code wherever the function is called in the program. This eliminates the multiple function call as well as the drudgery of typing the function code a large number of times in the program. Thus, the qualifier inline makes a program efficient and also lessens the work of the programmer. An illustration of its application is illustrated below.

 
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

The function difftime ()returns the difference between two calendar times in seconds, i.e., number of seconds elapsed between two calendar times time2 and time]. The calendar time represents the time elapsed since 00:00:00 hours 01 January 1970, GMT. The function returns the difference in seconds as a double number. The function prototype is written as follows:

 

Page 7 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.



Search Content







Popular Article