Bhanu Priya has Published 1581 Articles

Why files are needed in C programming language?

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 10:04:35

3K+ Views

Files is collection of records (or) it is a place on hard disk, where data is stored permanently. By using C commands, we access the files in different ways.Need of files in C languageEntire data is lost when the program terminates and storing in a file will preserve your data ... Read More

How to define pointer to pointer in C language?

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 10:00:54

331 Views

Declaring double pointer is similar to declaring pointer in C programming language. The difference is that only we need to add an additional ‘*’ before the name of pointer.SyntaxThe syntax is given below for declaring double pointers −int **ptr;ExampleFollowing is the C program for pointer to pointer − Live Demo#include // ... Read More

Explain the Union to pointer in C language

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 09:57:33

891 Views

A union is called as a memory location, which is shared by several variables of different data types.SyntaxThe syntax is as follows −union uniontag{    datatype member 1;    datatype member 2;    ----    ----    datatype member n; };For example, union sample{    int a;    float b; ... Read More

Explain the concept of union of structures in C language

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 09:54:13

577 Views

If the structure is nested inside a union, it is called as a union of structures. There is a possibility to create a union inside a structure in C programming language.ExampleFollowing is the C program for union of structures −#include struct x {    int a;    float b; }; ... Read More

Write a structure in local scope program using C language

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 09:53:13

330 Views

Structure is a collection of different datatype variables, grouped together under a single name.Features of structureThe features of structure are explained below −It is possible to copy the contents of all structure elements of different datatypes to another structure variable of its type by using an assignment operator.For handling complex ... Read More

State the difference between structure and union with suitable example in C language

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 09:51:16

1K+ Views

The differences between structures and unions in C language are explained below −S.NoStructureUnion1DefinitionStructure is heterogenous collection of data items grouped together under a single nameDefinitionA union is a memory location that is shared by several variables of different datatypes.2Syntax;struct tagname{    datatype member1;    datatype member2;    ----    ---- ... Read More

Explain the concept of Uninitialized array accessing in C language

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 09:48:46

823 Views

ProblemIn C language, is the program executed, if we use an uninitialized array?SolutionIf we use any uninitialized array, compiler will not generate any compilation and an execution error.If an array is uninitialized, you may get unpredictable result.So, it’s better we should always initialize the array elements with default values.Example ProgramFollowing ... Read More

What is out of bounds index in an array - C language?

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 09:46:45

2K+ Views

Suppose you have an array with four elements. Then, an array indexing will be from 0 to 3, i.e., we can access elements from index 0 to 3.But, if we use index which is greater than 3, it will be called as an index out of bounds.If, we use an ... Read More

Give the clarity on Pointer structures with suitable example in C language

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 09:45:25

103 Views

Pointer to structure holds the address of an entire structure.Mainly, these are used to create the complex data structures such as linked lists, trees, graphs and so on.The members of the structure can be accessed by using a special operator called arrow operator ( -> ).DeclarationFollowing is the declaration for ... Read More

What is an array of structures in C language?

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 09:44:42

1K+ Views

The most common use of structure in C programming language is an array of structures.To declare an array of structures, first the structure must be defined and then, an array variable of that type can be defined.For example, struct book b[10]; //10 elements in an array of structures of type ... Read More

Advertisements