Wednesday, 3 May 2017

Concepts in C ++.

User defined data types 

Structures 
and 
Unions.

Standalone variables of primitive types are not sufficient enough to handle real world problems.
It is often required to group logically related data items together.

Unions are conceptually similar to structures as they allow us to group together dissimilar type elements inside a single unit.
However the size of union is equal to size of its largest number element.
Eg:
 union result
 {
   int marks;
  char grade;
  float percent;
};        


No comments:

Post a Comment

Program to display ASCII value of any character.

Program #include<studio.h> #include<condo.h> void main( ) { char ch; clrscr(); printf("\n enter any character...