Skip to content

Tag Archives: C-Structure & Union

Class: It is a user-defined datatype enclosed with variables and functions. It is like a blueprint for an object. Class members are private by default.… Read More
1. Array in C : An array is collection of similar data items accessed by a common name stored at continuous memory locations. The elements… Read More
Data Types Data-type in simple terms gives us information about the type of data. Example, integer, character, etc. Data-types in C language are declarations for the… Read More
Array within a Structure A structure is a data type in C/C++ that allows a group of related variables to be treated as a single… Read More
Given an array arr[] containing N distances of inch-feet system, such that each element of the array represents a distance in the form of {inch,… Read More
A structure is a user-defined data type in C/C++. A structure creates a data type that can be used to group items of possibly different… Read More
Structures: Structures are used to store the data belonging to different data types under the same variable name. An example of a structure is as… Read More
Write a C program to store the information of Students using Structure. The information of each student to be stored is: Each Student Record should… Read More
Given student’s records with each record containing id, name and age of a student. Write a C program to read these records and display them… Read More
Array in C An array is collection of items stored at continuous memory locations. Structure in C A structure is a user defined data type… Read More
Prerequisite : sizeof operator in C The sizeof for a struct is not always equal to the sum of sizeof of each individual member. This… Read More
New programmers are usually in the search of ways to return multiple values from a function. Unfortunately, C and C++ do not allow this directly.… Read More
Prerequisites: Structure Member Alignment, Padding and Data Packing In Structure, sometimes the size of the structure is more than the size of all structures members… Read More
Prerequisite: Structures and Union QUE.1 What will be the output of this code? #include <iostream> using namespace std; typedef struct s1 {     int a;     float… Read More
Prerequisite: Structure and UnionQUE.1 What is the output of this program?  C #include <stdio.h> struct sample {     int a = 0;     char b = 'A';… Read More