Skip to content
WikiCoders.OrgWikiCoders.Org
  • Covid19 Live Tracking
  • Cheat Sheets
  • Programming
    • C Programs
      • Basic Programs
      • Array In C
      • Number System In C
      • Recursion In C
      • Unions In C
      • Linked List in C
    • C ++
      • Basics in C++
      • Loops in C++
  • About Us
  • Contribute
  1. Home
  2. /
  3. C Programs

Unions In C

  1. C Programs
  2. Unions In C

C Program to understand concept of Union

Union A union is a user-defined data type available in C that allows all members to store different data types in the same memory location. You can define a union with many members, but only one member can contain a value at any given time. Example Keyword used to define it is union. Like here, the union variable Emp has used […]
  1. Unions In C

C program to find the size of a union

Method 1 Without using sizeof operator #include<stdio.h> union student{ int roll; char name[100]; float marks; }; int main(){ union student *ptr = 0; ptr++; printf("Size of the union student: %d",ptr); return 0; } Output Size of the union student: 100

Best Sellers in Software @ Amazon

Categories

  • Blog
  • C Programs
    • Number System In C
    • Basic Programs
    • Recursion In C
    • Array In C
    • Unions In C
    • Linked List in C
  • C ++
    • Basics in C++
    • Loops in C++
  • DataStructure
  • MongoDB
  • Cheat Sheets

Categories

Pages

  • About Us
  • All Posts
  • Contact
  • Contribute
  • Coronavirus Live Real Time Stats Update
  • Perks and Offers
  • Privacy Policy
  • Profile
  • WikiCoders
  • Covid19 Live Tracking
  • Cheat Sheets
  • Programming
    • C Programs
      • Basic Programs
      • Array In C
      • Number System In C
      • Recursion In C
      • Unions In C
      • Linked List in C
    • C ++
      • Basics in C++
      • Loops in C++
  • About Us
  • Contribute

Made with ❤ in India