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

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

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

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

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:

 
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

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.

 

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.



Search Content





Popular Article