You are here:   HomeC Programming (Theory)Function and Pointer
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

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

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

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

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.

 
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

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

pointer is a very powerful and sophisticated feature provided in the C language. A variable defined in a program the compiler allocates a space in the memory to store its value. The number of bytes allocated to the variable depends on its type. For instance, a character is allocated 1 byte, an int is, in general, allocated 4 bytes, and a float is also allocated 4 bytes on a typical 32-bit system. The memory in RAM is grouped into bytes; each byte has 8 bits of memory. Bytes are sequentially numbered. Thus, each byte is associated with a number which is its address. When a variable is declared, a block of memory is allocated to store its value. The address of a variable is the byte number of the first byte of the memory block allocated for value storage. The value of a pointer to the variable is also the address where the value is stored, i.e., its value is the byte number of the first byte of the memory block where the value of variable is stored. A pointer to a data item is nothing but the address of that data item. Address of a variable may be determined by application of address-of operator (&).We can store this address in a variable, called the pointer variable, and use it to manipulate that data item. For instance, let Marks be a variable of type int. On a 32-bit system, Marks would be allocated a memory block of size 4 bytes for storing its value.



 
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.



 

Page 1 of 10



Subscribe To Free Daily Newsletter!

Get Free News Updates Delivered Directly To Your Inbox
About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes 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.



What's New and Popular





Popular Article