Published on: 12th Nov 2010    |   Last Updated on: 24th Nov 2011

Difference Between Array and Stucture :


Array Structure
i. Data Collection     
Array is a collection of homogeneous data. Stucture is a collection of heterogeneous data.
ii. Element Reference     
Array elements are referred by subscript. Structure elements are referred by its unique name.
iii. Access Method     
Array elements are accessed by it's position or subscript. Stucture elements are accessed by its object as '.' operator.
iv. Data type     
Array is a derived data type. Structure is user defined data type.
v. Syntax     
<data_type> array_name[size];
struct struct_name
{
    structure element 1;
    structure element 2;
	----------
	----------
	structure element n;
}struct_var_nm;
vi. Example     
 int rno[5];
struct item_mst
{
    int rno;
    char nm[50];
}it;

Fig.: Difference between Array and Structure



Link this post on your Blog/Website :

Follow us on :   Technoexam on facebook Technoexam on twitter Technoexam on linkedin Technoexam on youtube