C Language Archive

size of structure in c

Size of structure: Structure is a collection of elements. The size is equals to sum of sizes of individual elements. sizeof() function can be used to specify the size. We can find the size either …

C Local and Global structures

Local structure: Define structure inside the function. It can be accessed only from the same function in which it has defined. Global structure: Define structure outside to all functions. Global structure can be accessed through …

C structure as parameter

Passing structure as a parameter: We have seen the programs in which passing primitive types(int, float….) and derived types(arrays and strings). We can also pass, structure as a parameter. When we pass the structure, only …

C Function return structure

Function returning structure: A function can return the structure type. We need to specify the structure type as return type. It returns the base address of structure memory block. We collect the returned address into …

Array of Structures in C

Array of Structures: Using structure variable we can store only one record. To store multiple records, we need to declare Array variable of structure type. We use loop to process elements of these records.

Arrays in Structures Code in C

Arrays in structure: We can store an array inside the structure as structure element. To access elements of that array, we use loops.

Nested Structures in C

Nested structures: Defining a structure inside another structure. We access the elements of nested structure using outer structure reference variable. Note: to access the elements of a structure that is a part of another structure, …

Pointers in C

Pointer: It is a derived data type. Pointer variable holds address of memory block. We can process the data directly using pointers(holding addresses) Syntax:             datatype*  identity;                         (or) datatype  *identity;  Types of pointers: Typed: …

Call by Value in C

Call by Value: Calling the function by passing value as parameter. We collect the value into an argument of function. Arguments are working like local variables. Processed arguments can access only from same function. Swapping …

Call by Reference in C

Swapping using Call by Reference: While calling a function if we pass address of actual parameters as arguments to the formal parameters in the calling function known as call by reference. In call by reference …

Courses Enquiry Form