Created
April 21, 2021 16:12
-
-
Save freakflames29/d1ba6e54eee44a1d6be74fe08066f7d0 to your computer and use it in GitHub Desktop.
nested structure in c++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
struct Read | |
{ | |
string areyou; | |
struct Book | |
{ | |
string name; | |
struct Price | |
{ | |
int price; | |
}prices; | |
}books; | |
}reads; | |
int main() | |
{ | |
reads.books.name="rework"; | |
reads.books.prices.price=500; | |
cout<<"Bookname: "<<reads.books.name<<endl; | |
cout<<"Price: "<<reads.books.prices.price<<endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment