C programming language, computer class in ahmedabad, online computer coaching, TCCI Coaching Institute

What is use of structure in C- TCCI

Structures – is used to store different type of data at same location like books, student, etc.

What-is-use-of-structure-C_simple

The most efficiently data structures are used in c is stack, queue, tree, linked list, doubly linked list, hash table etc.

Syntax:

struct student{

char name[20];

int rollnumber;

float percentage;

}

in a structure and create various variables related to that structure for each individual student. Suppose you have 10 students in your batch. Then you can create an array of 10 variables of type student as:

struct student s[10];

nd indiviually use them as:

s[0].rollnumber=2005;

The compiler itself uses stack when it compiles any code. As you can notice stack frame and stack pointer.

Queue is used for many operations like in railway ticket booking counter, or any queue related operations.

Tree is used for file hirearchy in your system or any where the hirearchy related situation is there, tree is the option for you.

To learn more in detail about structure at TCCI

Call @ 9825618292

Visit us @ http://tccicomputercoaching.com/

 

Leave a comment