## What are the Format Specifiers used with printf

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.

## Accessing Matrix Elements by Using Array Name as a Pointer

by Dinesh Thakur Category: Function and Pointer

As we know, the expression x [i] to access the ith element of vector x can be equivalently written using pointer notation as * (x+i) . Thus, the expression a [i] [j] to access the ijth element of matrix a can be equivalently written as * (*(a+i) +j). Observe that this expression is obtained by applying twice the construct used for a vector. The address of a [i][j] is thus given as * (a+i) +j. These results are summarized below.

## One-Dimensional Array with Pointer in C

by Dinesh Thakur Category: Function and Pointer

The name or identifier of an array is itself a constant pointer to the array. Its value is the address of the first element of the array. Thus, a pointer to an array may be declared and assigned as shown below.

## Two-Dimensional Arrays Using a Pointer to Pointer

by Dinesh Thakur Category: Function and Pointer

Since a pointer to type T is analogous to an array of type T, a pointer to a pointer (T**) is analogous to an array of type T*, i. e., an array of pointers to type T. Each element in this array of pointers can be used further to point to an array of type T. Thus, a pointer to a pointer can be used to represent two-dimensional arrays, as illustrated in Fig.

## What is the default return value of a function

by Dinesh Thakur Category: Function and Pointer

The default returns value from a function in int. In other words generally unless explicitly specified the default return value by compiler would be integer value from function. So when a programmer wants other than integer values to be returned from function then it is essential that the programmer takes some steps in doing this namely:

## How is the main() function declared

by Dinesh Thakur Category: Function and Pointer

The main () is a special function that marks the beginning of the program. The type int before main signifies that function main () returns an integer value to the system on its completion.

## C Program manipulating array elements with pointers

by Dinesh Thakur Category: Function and Pointer

An individual element of an array may be regarded as a variable of the type declared in the declaration of the array. All the operators that can be applied to a variable of that type are applicable to the elements of array as well. Program, the array elements are subjected to arithmetic operations with the help of pointers.

## Function Definition in C

by Dinesh Thakur Category: Function and Pointer

A function definition comprises a head (or header) and a body. The header gives the information about type of function, name of function, and a list of parameters. The list of parameters comprises types and names of parameters enclosed in parentheses and separated by commas. An illustration of function definition is given below.

## C Program Tower of Hanoi

by Dinesh Thakur Category: Function and Pointer

The Tower of Hanoi problem consists of three poles, left, middle, and right. One of the poles (say, the left) contains n disks of different sizes placed on each other, as shown in Fig. The objective of the problem is to transfer all the disksfrom the left pole to right pole such that only one disk can be moved at a time (to any pole) and a larger  disk cannot be placed on top of a smaller disk.

## C Program function to return the maximum of three numbers

by Dinesh Thakur Category: Function and Pointer

It accepts three parameters  x,y, and z, each of type double and returns a value of type double.

Page 3 of 8

Dinesh 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