Data structure is the representation of logical relationship existing between individual elements of Data.In other words a data structure is a way of organizing all data items that considers not only the element store but also their relationship to each other.we can also define it as mathematical or logical model of particular organization of data items.
Data structures are building blocks of program and hence the selection of a particular data structure stresses on the following two things:
1) The data structure must be rich enough in structure to reflect the relationship existing between the data.
2) And structure must be simple so that we can process data effectively when ever required.
Sunday, December 27, 2009
Monday, November 23, 2009
Storage classes in C
They are 4 according to the visibility and life time of variable in a program.
Automatic
-------------
It is the default storage class in C.Here variable get focus while program reach the function and lose scope or visibility while program leave the Function . They are local to the function in which they are declared ie,The scope of the variable limited inside the function.We can use a keyword auto to declare these kind of variable.
Global
---------
Global variables are also called external variables.They are declared outside the main() at global declaration section.Or we can declare them using keyword extern.They can access anywhere from the program and by all functions. They have life time same as that of program.
Static
----------
Here we declare variables with the keyword static.These are local to function in which it is declared.They have life time same as that of program.The value hold by the static variable dn't flush until the programs execution ends.
Register
---------------
These storage class use for fast access of frequently used variables. They are declared with keyword register.The difference with other storage class is that they are stored in the cpu register which is a high speed memory location.
Automatic
-------------
It is the default storage class in C.Here variable get focus while program reach the function and lose scope or visibility while program leave the Function . They are local to the function in which they are declared ie,The scope of the variable limited inside the function.We can use a keyword auto to declare these kind of variable.
Global
---------
Global variables are also called external variables.They are declared outside the main() at global declaration section.Or we can declare them using keyword extern.They can access anywhere from the program and by all functions. They have life time same as that of program.
Static
----------
Here we declare variables with the keyword static.These are local to function in which it is declared.They have life time same as that of program.The value hold by the static variable dn't flush until the programs execution ends.
Register
---------------
These storage class use for fast access of frequently used variables. They are declared with keyword register.The difference with other storage class is that they are stored in the cpu register which is a high speed memory location.
Subscribe to:
Posts (Atom)