1.
Difference Between Call by value and Call
by reference
2.
Difference Between Array and Structure
3.
Difference Between Library Function and
User Define Function
4.
Difference Between Macro and Function
5.
Difference Between Structure and Union
6.
Difference Between ASCII File and Binary
File
1. Difference Between Call by value and
Call by reference
Call by value
|
Call by reference
|
In call by value,
|
In call by reference, the address of actual arguments is passed to formal arguments of the called function.
|
In call by value method the called function works with dummy arguments.
|
In call by reference method the
called function works with actual arguments.
|
In call by value, actual arguments will remain
|
In call by reference, actual
arguments can be modified inside function.
|
2. Difference Between Array and
Structure
Array
|
Structure
|
Array is a collection of variable of same data type that share
common name.
|
Structure is a collection of variables of different type
that share
common name. |
Array is also called derived data type because it is
derived from primary data types.
|
Structure is called user define data type because it is
defined
by user as per his requirements. |
Array elements
|
Structure members
|
Accessing array elements take less time as compared to structure.
|
Accessing structure elements take more time as compared
to Array.
|
3. Difference Between Library Function
and User Defined Function
Library Function
|
User Define Function
|
There is no need to declare and define library function.
|
Programmer must have to declare and define user define
functions.
|
In order to use library function programmer have to
include header file.
|
In order to use user define functions programmer does
not have to include header files.
|
They are predefined in header files.
|
They are defined by users as per their requirements.
|
4. Difference Between Macro and Function
Macro
|
Function
|
Macro is Preprocessed. There is
no need to compile it.
|
Function need to be compiled.
|
Execution of function is slower.
|
Execution of macro is faster.
|
Consumes less memory.
|
Consumes more memory.
|
Macro cannot be extends beyond
one line.
|
Function can extend up to any
number of line.
|
5. Difference Between Structure and
Union
Structure
|
Union
|
Compiler allocates separate memory
|
Compiler allocates common memory space for all members of union
|
Hence all the member having separate memory allocation
|
Hence all the members having common memory allocation
|
6. Difference Between ASCII and Binary
File
ASCII File
|
Binary File
|
It occupies more memory space as compared to
|
It occupies less memory space as compared to ASCII file.
|
It is less efficient.
|
It is more efficient.
|
Some characters may be “hidden” from file even if the
characters are still in the file.
|
You can access every byte in the file.
|
Post a Comment
Please do not enter any spam link in the comment box.