Tutorials
Courses
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Misc
8.8K+ articles
Arrays
6.5K+ articles
C++
4.3K+ articles
Difference Between
3.6K+ articles
C Language
1.8K+ articles
Data Structures
1.1K+ articles
C-Structure & Union
43+ articles
cpp-struct
9+ articles
cpp-structure
19 posts
Recent Articles
Popular Articles
Output of C++ programs | Set 41 (Structure and Union)
Last Updated: 29 August 2017
Prerequisite: Structures and UnionQUE.1 What will be the output of this code?CPP #include iostreamusing namespace std;typedef struct s1 { int a; float b; ...
read more
C++
cpp-structure
C-Output
C-Structure & Union
C program to print employee details using Structure
Last Updated: 04 January 2023
In this program, we will read and display details of n employees using Structure. Employee details like Name, age, phone number, salary will be printed. Method :Declare va...
read more
Misc
C++ Programs
Computer Science Fundamentals
cpp-structure
alignof operator in C++
Last Updated: 08 June 2018
In C++11 the alignof operator used to returns the alignment, in bytes of the specified type.Syntax:alignof(type)Syntax Explanation: alignof: operator returns the align...
read more
Misc
C++
cpp-structure
Find k pairs with smallest sums in two arrays | Set 2
Last Updated: 04 December 2023
Given two arrays arr1[] and arr2[] sorted in ascending order and an integer K. The task is to find k pairs with the smallest sums such that one element of a pair belongs t...
read more
Algorithms
Greedy
DSA
cpp-structure
Pointers
Arrays
cpp-pair
Queries to insert, delete one occurrence of a number and print the least and most frequent element
Last Updated: 14 March 2023
Given Q queries of type 1, 2, 3 and 4 as described below.Type-1: Insert a number to the list.Type-2: Delete only one occurrence of a number if exists.Type-3: Print the lea...
read more
Misc
Hash
Data Structures
C++
DSA
cpp-structure
Data Structures-Hash
C++-Operator Overloading
cpp-set
Number of elements greater than K in the range L to R using Fenwick Tree (Offline queries)
Last Updated: 29 November 2023
Prerequisites: Fenwick Tree (Binary Indexed Tree)Given an array of N numbers, and a number of queries where each query will contain three numbers(l, r and k). The task is ...
read more
Sorting
Advanced Data Structure
Competitive Programming
DSA
array-range-queries
Binary Indexed Tree
cpp-structure
Bit Algorithms
Slack Bytes in Structures : Explained with Example
Last Updated: 16 August 2021
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 shown below:struct STUDENT...
read more
C Language
DSA
cpp-structure
C-Structure & Union
cpp-struct
How to pass or return a structure to/from a Function in C/C++?
Last Updated: 16 December 2019
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 types into a single type.How to pas...
read more
C++
cpp-structure
C-Structure & Union
C/C++ program to add N distances given in inch-feet system using Structures
Last Updated: 21 May 2020
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, feet}. The task is to add ...
read more
Mathematical
C Programs
C++ Programs
Data Structures
Programming Language
C Language
DSA
cpp-structure
C-Structure & Union
Structure & Union
cpp-struct
Array of Structures vs Array within a Structure in C
Last Updated: 10 January 2025
Both Array of Structures and Array within a Structure in C programming is a combination of arrays and structures but both are used to serve different purposes.Array within...
read more
Data Structures
Difference Between
C Language
C++
DSA
Arrays
cpp-structure
C-Struct-Union-Enum
Arrays
C-Structure & Union
cpp-struct
Advantages and Disadvantages of Array in C
Last Updated: 02 November 2023
An array is a data structure that stores a collection of elements, all of the same data type, in a contiguous block of memory. Each element in the array is identified by a...
read more
Linked List
C Programs
Data Structures
Difference Between
Articles
C Language
DSA
Arrays
cpp-structure
Classes vs Structure vs Union in C++
Last Updated: 19 January 2021
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. For Example, the ca...
read more
Technical Scripter
C++ Programs
C++
Technical Scripter 2020
cpp-structure
cpp-class
C-Structure & Union
Structure & Union
Why does empty Structure has size 1 byte in C++ but 0 byte in C
Last Updated: 04 August 2021
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 types into a single type.The ‘struc...
read more
misc
C Language
C++
cpp-structure
memory-management
C-Structure & Union
Array of Structures vs Array within a Structure in C++
Last Updated: 08 February 2024
In C++, an array of structure and an array within structure are used frequently used for data storage. Although they sound similar, they work pretty differently from each ...
read more
C++
Picked
Geeks Premier League
cpp-array
cpp-structure
Geeks Premier League 2023
Structure Padding in C++
Last Updated: 16 June 2025
In C++, a structure (struct) is a user-defined data type that allows grouping variables of different types under a single name. When we define a structure, the compiler ma...
read more
C Language
cpp-structure
1
2
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !