شرح struct في سي بلس بلس

شرح struct في سي بلس بلس


#include <iostream>
#include <string>
using namespace std;

struct book{

string book_name;
string writer;
double price;


};

int main()
{
book p1,p2,p3;

p1.book_name="first book";
p1.price=100;

cin>>p3.book_name>>p3.price;

p2.book_name="second book";
cout<<p2.book_name<<endl;
cout<<p1.price<<endl;
cout<<"p3 book name : "<<p3.book_name<<" price :"<<p3.price<<endl;

}