Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #define TYPE_MAX 50
  4. #define PHONE_NUMBERS 3
  5. #define MANUY_NUM 200
  6.  
  7. typedef struct
  8. {
  9. char city[TYPE_MAX];
  10. char street[TYPE_MAX];
  11. int houseNum;
  12. }Address;
  13.  
  14.  
  15.  
  16. typedef struct
  17. {
  18. char areaCode[TYPE_MAX];
  19. char phone[TYPE_MAX];
  20. }Phone;
  21.  
  22.  
  23. typedef Phone allPhone[PHONE_NUMBERS];
  24.  
  25.  
  26. typedef struct
  27. {
  28. char manuyName[TYPE_MAX];
  29. Address manuyAddress;
  30. allPhone manuyPhones;
  31. }Manuy;
  32.  
  33. typedef struct
  34. {
  35. int manuy_count;
  36. Manuy allManuy[MANUY_NUM];
  37. }Phone_book;
  38.  
  39. void main()
  40. {
  41. Manuy m;
  42. int i, choice;
  43. printf("Welcome to the phone book.\n\n");
  44. printf("For adding a manuy to the book - press 1.\n");
  45. printf("For locating an existing manuy - press 2.\n");
  46. printf("For deleting an existing manuy - press 3.\n");
  47. printf("For sorting all the manuyim in an ascending order by name - press 4.\n");
  48. scanf("%d", &choice);
  49. switch (choice)
  50. {
  51. case 1:
  52. {
  53. add_manuy(&m);
  54.  
  55. }
  56. }
  57. }
  58.  
  59. void add_manuy(Manuy *pt)
  60. {
  61.  
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement