What is use of structure in C- TCCI

Page 1

What is use of structure in C- TCCI Structures - is used to store different type of data at same location like books, student, etc.

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.


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.