Join Regular Classroom : Visit ClassroomTech

Programming in C

Usage of enum in C

Enumeration is a user defined datatype in C language. It is used to:1. Assign names to the integral constants.2. Makes a program easy to read and maintain program readability and better debugging capability..3. Enum has a great choice for using as flag.4. In enum, variables are automatically assigned with a key value starting from 0. Let’s see an example Output:

Usage of enum in C Read More »

Unions in C

A union is a user defined datatype that also like structure allows to store different datatypes but in union it stores in similar location. In union one member can contain only one value at a time. So, the size of union will be lesser than the size of structure. So, union is more efficient where

Unions in C Read More »

Initializing and accessing members of a structure type data in C

Like any other variable, a structure variable can also be initialized where they are declared. There is a one-to-one relationship between the members and their initializing values. To access the members, we have to use ” . “(the dot operator). Don’t know what is structure type data in C? Read: Structure datatype in C Example

Initializing and accessing members of a structure type data in C Read More »