Learn Array vs. Structure in Bopal- TCCIComputerCoaching

Page 1

Learn Array vs. Structure in Bopal- TCCIComputerCoaching Welcome to TCCI-Tririd Computer Coaching Institute. In Programming Language array and structure both are used to store data. But functionality, behaviour, data types are different. Let us see in details what these differences are.

Arrays

Structures

1. An array is a collection of 1. Structure is a collection of data related data elements of same elements of different types. type. 2. An array is a derived data type

2. A structure is a User-defined data type.

3. Any array behaves like a built-in 3. But in the case of structure, first data types. All we have to do is to we have to design and declare a data declare an array variable and use structure before the variable of that it. type are declared and used. 4. We can access array elements 4. In structure we can access with its elements with its variable Position.

i.e. structure students{

i.e. int a[10];

int rn;

the a[0],a[1]……

float marks; char name[10]; }s; We have to s.rn,s.marks,s.name[0],…….

access

5. But we can use array into 5. We can’t access structure in structure as an element. array.

To learn more about programming languages, Computer Course, Live Project Training


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.