In this section, we will discuss the Structure pointer in the C programming language. Before going to the concepts, let's understand the Structure. The structure is the collection of different data types grouped under the same name using the struct keyword. It is also known as the user-defined data type that enables the programmer to store different data type records in the Structure. Furthermore, the collection of data elements inside the Structure is termed as the member.
For example, suppose we want to create the records of a person containing name, age, id, city, etc., and these records cannot be grouped in the single dimension array. Therefore, we use the Structure to store multiple collections of data items.
Syntax to define Structure
struct structure_name
{
char name[40];
int roll_no;
float percentage;
char sub[30];
};
struct structure_name str; // str is a variable of the structure_name