Blog Introductions

In this  blog contains tutorials about  HTML Tutorials, Python Tutorials, CSS Tutorials, How to, PHP Tutorials, Java Tutorials, C++ Tutorials, Tutorials,  Examples, Source code,Learning,
Tips and Software development  services.C++ Structure and their work  -  C++ Tutorials Bestitworrior 


C++ Structure and their work  



C++ Tutorials




C++ Structure and their work  -  C++ Tutorials Bestitworrior - C++ structure use to way group serval variables in to one place.Each variable in structure is known as structure member.Structure holds multiple variables in one place.We can add variable outside the structure and seperate comas


Some Key Points of Structures

  1. Structure hold serval variables in to one place.
  2. Structure declear with struct keyword.
  3. Structure variables known as structure members.
  4. Structure object variable declear outside of structure brackets
  5. Structure variable access by using object_variable.name(variable name)

Code



 #include<iostream>
using namespace std;
struct {
string name;
string father_name;
int age;
} student1, student2;

int main(){


student1.name = "Anan";
student1.father_name = "Altaf";
student1.age = 1999;

student2.name = "Adnan";
student2.father_name = "Altaf";
student2.age = 1998;

cout << student1.name << " " << student1.father_name << " " << student1.age << "\n";
cout << student2.name << " " << student2.father_name << " " << student2.age << "\n";

return 0;

}






OutPut



Anan Altaf 1999
Adnan Altaf 1998


I hope You really enjoyed this blog . I try my best to make every thing is easy and helpfull to provide to public .You will get more blog about the Programing project and code . Thanks for visiting my blog if you have any querry related to this you can comment here i will try my best to response you back about C++ Structure and their work  -  C++ Tutorials Bestitworrior