Structure in c | structure padding | by dubebox

preview_player
Показать описание
In this video , we will understand the concept of structure in c programming language, and will understand the role of structure padding for memory allocation.

What is structure ?

A structure is an arrangement , and organization of interrelated elements , in a material object .

In C language , It is an arrangement of different data types. And , this arrangement itself a data type , which has to be defined by user.
So, a structure is a user defined data type , which allows us to combine data, of different types together.

Next question we can have , why do we need structure , while we are having array?

The answer is very simple, memory can be allocated for same data type with array. But, with the help of structure, we can have memory allocation for different data type as well.

==================== content of this video ==========================

0:00 Introduction
0:38 Declaration & initialisation
1:22 Size of structure and structure padding

#structure #cprogramming #bydubebox #structurepadding
Рекомендации по теме