by Dinesh Thakur Category: Function and Pointer

Printf function always returns the number of characters printed by the printf function. Let us see this in brief with an example:

 
by Dinesh Thakur Category: Function and Pointer

Except a few, most of the programs in C may be written with or without pointers. Then the question arises "Why use pointers if you can do without them?” Pointers are considered to be useful tools in programming because of the following reasons:

 
by Dinesh Thakur Category: Function and Pointer

To manipulate data using pointers, the C language provides two operators: address (&) and dereference (*). These are unary prefix operators. Their precedence is the same as other unary operators which is higher than multiplicative operators.

 
by Dinesh Thakur Category: Function and Pointer

Functions may be return type functions and non-return type functions. The non-return type functions do not return any value to the calling function; the type of such functions is void. These functions may or may not have any argument to act upon. A few illustrations of such functions are given below.

 
by Dinesh Thakur Category: Function and Pointer

There are several format Specifiers available in printf. The format specifier used varies depending on the data type used for printing. The given below are some of the format Specifiers used with printf in C program.



 
by Dinesh Thakur Category: Function and Pointer

The declaration of a pointer variable in C, comprises the type of pointer followed by indirection operator (*) which is followed by an identifier for the pointer. The declaration is done as follows:

 
by Dinesh Thakur Category: Function and Pointer

If elements of an array are two-dimensional arrays, the array is called a three-dimensional array. Therefore, a three-dimensional array may be considered as an array of matrices. Let Arm be a 3-dimensional array or an array of matrices. The declaration of pointer and its initialization is carried out as given below.

 
by Dinesh Thakur Category: Function and Pointer

The return statement is used to terminate the execution of a function and transfer program control back to the calling function. In addition, it can specify a value to be returned by the function. A function may contain one or more return statements. The general format of the return statement is given below.

 

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