Courses
Tutorials
Interview Prep
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Similar Topics
Web Technologies
32.1K+ articles
C++
3.8K+ articles
C Language
1.3K+ articles
C Programs
442+ articles
Arrays
257+ articles
C Basics
78+ articles
Sorting Quiz
49+ articles
C-Structure & Union
44+ articles
cpp-structure
19+ articles
cpp-struct
9+ articles
C-Struct-Union-Enum
16 posts
Recent Articles
Popular Articles
When to Use Enum Instead of Macro in C?
Last Updated: 23 July 2025
In C programming, bothenums (short for enumeration)andmacros are used for defining symbolic names associated with specific values. However, there are situations where usin...
read more
C Programs
C Language
Picked
C Macro
C-Struct-Union-Enum
C Examples
When to Use Enum Instead of Define in C?
Last Updated: 23 July 2025
In C programming, both#defineandenumcan be used to declare integer constants but there are situations where usingenumis more beneficial than#define. In this article, we wi...
read more
C Programs
C Language
Picked
C Basics
C-Struct-Union-Enum
C Examples
How to Modify Struct Members Using a Pointer in C?
Last Updated: 23 July 2025
In C++, we use structure to group multiple different types of variables inside a single type. These different variables are called the members of structures. In this artic...
read more
C Programs
C Language
Picked
C-Struct-Union-Enum
C-Pointers
C Examples
How to Use a Union to Save Memory in C?
Last Updated: 23 July 2025
Unions in C offer a unique mechanism for storing different variables in the same memory location. These variables are called members of the union and can be of different t...
read more
C Programs
C Language
Picked
C-Struct-Union-Enum
C-Structure & Union
C Examples
How to Declare a Pointer to a Struct in C?
Last Updated: 23 July 2025
Structure (or structs) in the C programming language provides a way to combine variables of several data types under one name and pointers provide a means of storing memor...
read more
C Programs
C Language
Picked
C-Struct-Union-Enum
C-Pointers
C Examples
Difference between Struct and Enum in C/C++ with Examples
Last Updated: 23 July 2025
Structure in C++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...
read more
C++
C-Struct-Union-Enum
Array of Structures vs Array within a Structure in C
Last Updated: 15 July 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
C Language
cpp-structure
C-Struct-Union-Enum
Arrays
C-Structure & Union
cpp-struct
C program to store Student records as Structures and Sort them by Name
Last Updated: 11 July 2025
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 in sorted order by name.Example...
read more
C Programs
C Language
Sorting Quiz
C-Struct-Union-Enum
“static const” vs “#define” vs “enum”
Last Updated: 11 July 2025
In this article, we will be analyzing "static const", "#define" and "enum". These three are often confusing and choosing which one to use can sometimes be a difficult task...
read more
C++
Picked
Technical Scripter 2018
C-Struct-Union-Enum
Designated Initializers in C
Last Updated: 27 April 2022
Standard C90 requires the elements of an initializer to appear in a fixed order, the same as the order of the elements in the array or structure being initialized.In ISO C...
read more
C/C++ Puzzles
Technical Scripter
C Language
c-array
C-Struct-Union-Enum
Structure Sorting (By Multiple Rules) in C++
Last Updated: 23 July 2025
Prerequisite : Structures in CName and marks in different subjects (physics, chemistry and maths) are given for all students. The task is to compute total marks and ranks ...
read more
C++
cpp-structure
C-Struct-Union-Enum
Enumeration (or enum) in C
Last Updated: 08 April 2026
In C, an enumeration (or enum) is a user-defined data type that contains a set of named integer constants. It is used to assign meaningful names to integer values, which m...
read more
C Language
C Basics
cpp-data-types
C-Struct-Union-Enum
Unions in C
Last Updated: 25 October 2025
A union is a user-defined data type that can hold different data types, similar to a structure.Unlike structures, all members of a union are stored in the same memory loca...
read more
C Language
C Basics
C-Struct-Union-Enum
Struct Hack
Last Updated: 06 September 2021
What will be the size of following structure?CPP struct employee{ int emp_id; int name_len; char name[0];}; 4 + 4 + 0 = 8 bytes.And what ...
read more
C Language
cpp-structure
C-Struct-Union-Enum
Structure Member Alignment, Padding and Data Packing
Last Updated: 29 July 2025
In C, the structures are used as data packs. They don't provide any data encapsulation or data hiding features.In this article, we will discuss the property of structure p...
read more
C Language
C-Struct-Union-Enum
1
2