Structures in C++

| Last Updated: | In: C++ Tutorial


In this tutorial, I will explain how to use the Structures in c++ programming language. This tutorial will explain you about the Structures in C++ program. After going through of this tutorial, you will able to know:

  1. What is a structure in C++?
  2. How to declare structures in C++?
  3. How to write a program using structures in C++?

What is a structures in C++

The structure is a collection of variables of different data types in a single variable name. It is just like of similar to the class, it holds the collection of data types.

How to declare structures in C++

Below example will show you declare structures in C++ in your program.

How to write a program using structures in C++?

Below program will take input as your full name, your age, and your salary, then this program will print the output as:

Copy and paste below program and execute it to better under standing of structure in C++ programming language.

Output:

Enter your full name: Prem Tiwari
Enter your age: 29
Enter your salary: 30000
**********************************
Input Information.
Name: Prem Tiwari
Age: 29
Salary: 30000


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


You may also like:

Tags: , , , ,