by Dinesh Thakur Category: Function and Pointer

Argument: An argument is an expression which is passed to a function by its caller (or macro by its invoker) in order for the function(or macro) to perform its task. It is an expression in the comma-separated list bound by the parentheses in a function call expression.

 
by Dinesh Thakur Category: Function and Pointer

Let us write a program to calculate the area' and circumference of a circle using user-defined functions. A function area_circum to accept the radius of a circle and print its area and circumference is given in Example. However, rather than printing the results in a function, it is good practice to return the results to the calling function, where they can be printed or used for further processing, if required. Hence, let us return the results (area and circumference) to the calling function.

 
by Dinesh Thakur Category: Function and Pointer

We saw that pointer values may be assigned to pointers of same type. However, pointers may be type cast from one type to another type. In the following code lines, A is an int type variable, D is variable of type double, and ch is a variable of type char. Pa is declared as a pointer to int variables, Pd is declared as a pointer to double type variables, and Pc is declared as pointer to character type variables. Pa is assigned the value &A.

 
by Dinesh Thakur Category: Function and Pointer

In C, program execution starts from the main() function. Every C program must contain a main() function. The main function may contain any number of statements. These statements are executed sequentially in the order which they are written.

 
by Dinesh Thakur Category: Function and Pointer

Recall that a function call takes the form

func_ name ( arg_list )

 
by Dinesh Thakur Category: Function and Pointer

In C, we can supply arguments to 'main' function. The arguments that we pass to main ( ) at command prompt are called command line arguments. These arguments are supplied at the time of invoking the program.

 
by Dinesh Thakur Category: Function and Pointer

It would not be wrong to say that C language is a function-based language. The C Standard Library contains a large number of predefined functions which may be called in programs for carrying out various processes. Related functions are grouped together under various header files.

 
by Dinesh Thakur Category: Function and Pointer

Pass by Value: In this method, the value of each of the actual arguments in the calling function is copied into corresponding formal arguments of the called function. In pass by value, the changes made to formal arguments in the called function have no effect on the values of actual arguments in the calling function.

 
by Dinesh Thakur Category: Function and Pointer

A goto statement implements a local jump of program execution, and the longjmp() and setjmp() functions implement a nonlocal, or far, jump of program execution. Generally, a jump in execution of any kind should be avoided because it is not considered good programming practice to use such statements as goto and longjmp in your program.

 

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