What Is Nested Structure?
3 years ago
C Programming
A structure inside another structure is called a nested structure.
Ex –
// C program to implement
// the above approach
#include <stdio.h>
// Declaration of the outer
// structure
struct Organisation
{
char organisation_name[20];
char org_number[20];
// Declaration of the employee
// structure
struct Employee
{
int employee_id;
char name[20];
int salary;
// This line will cause an error because
// datatype struct Employee is present,
// but the Structure variable is missing.
Rusma Khadka
Dec 29, 2022