For example, if you don’t know how much memory is required by objects in your program, you can still run a program in C and assign the memory at the same time. Learn the Basic Structure of C Program in 7 Mins. C follows a system based programming system. It means the programming is done for the hardware devices. C program structure is divided into various sections, namely, headers, class definition, member functions definitions and main function. Note that C provides the flexibility of writing a program with or without a class and its member functions definitions. Following is the basic structure of a C program. Documentation Consists of comments, some description of the program, programmer name and any other useful points that can be referenced later. Purpose of Array within Structure. When you find yourself to store a string value, then you have to go for array within structure. Because your name comes under character data type alone, thus array is capable of storing data of same data type. C program - Arrays within Structure (Easy) Lets code array within structure and have some fun.
C provides us the feature of nesting one structure within another structure by using which, complex data types are created. For example, we may need to store the address of an entity employee in a structure. The attribute address may also have the subparts as street number, city, state, and pin code. Hence, to store the address of the employee, we need to store the address of the employee into a separate structure and nest the structure address into the structure employee. Consider the following program.
Seshadri iyer astrology books pdf 2017. Output

The structure can be nested in the following ways.
- By separate structure
- By Embedded structure
1) Separate structure
Here, we create two structures, but the dependent structure should be used inside the main structure as a member. Consider the following example.
As you can see, doj (date of joining) is the variable of type Date. Here doj is used as a member in Employee structure. In this way, we can use Date structure in many structures.
2) Embedded structure
The embedded structure enables us to declare the structure inside the structure. Hence, it requires less line of codes but it can not be used in multiple data structures. Consider the following example.
Accessing Nested Structure

We can access the member of the nested structure by Outer_Structure.Nested_Structure.member as given below:
C Nested Structure example
Let's see a simple example of the nested structure in C language.
Output:
Passing structure to function
Just like other variables, a structure can also be passed to a function. We may pass the structure members into the function or pass the structure variable at once. Consider the following example to pass the structure variable employee to a function display() which is used to display the details of an employee.