Advertisement
Guest User

structure, substructure

a guest
May 25th, 2014
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <cstring>
  4. using namespace std;
  5.  
  6. struct Book
  7. {
  8.     char title[30],author[30];
  9.     float price;
  10.     int year_of_publication;
  11. };
  12.  
  13. struct Author
  14. {
  15.     char name[30],subname[30];
  16.     int birth_date;
  17.     struct Book x[15];
  18. };
  19.  
  20. struct Library
  21. {
  22.     struct Author y[15];
  23. };
  24.  
  25. void readBooks(struct Library tab[], int n)
  26. {
  27.     int i,j;
  28.     for(i=0;i<n;i++)
  29.     {cout<<"Input "<<i+1<<". authors name"<<endl;
  30.     gets(tab[i].Author[y].name);
  31.     gets(tab[i].Author[y].subname);
  32.  
  33.     }
  34. }
  35. int main()
  36. {
  37.  
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement