ABSTRACT

This chapter describes structure as a user-defined data type. We use variables of built-in data types to store values in memory in programming constructs. Structures can be nested within one another. We can use one structure variable as a data member of another structure. When one structure variable can be used as another structure member, then it is called as nested structure. Dynamic memory allocation is required whenever there is a pointer variable in the program. It is a unique feature of C language. In dynamic allocation of memory, certain amount of memory is requested from the memory heap. If request is granted, then that much amount of memory is reserved for the program. A pointer of type student structure is declared to point to the structure. Memory to this structure is allocated dynamically using malloc and calloc functions.