fork download
  1. #include <stdio.h>
  2.  
  3. // 1. MUST DEFINE THIS FIRST SO RACE DETAILS CAN USE IT
  4. struct date {
  5. int month;
  6. int day;
  7. int year;
  8. };
  9.  
  10. // ==========================================
  11. // ENUMERATED TYPES
  12. // ==========================================
  13. typedef enum {
  14. Fast, Wet_Fast, Slow, Sealed, Firm, Soft, Heavy, Good, Muddy, Sloppy
  15. } track_conditions;
  16.  
  17. typedef enum {
  18. Maiden_Special_Weight, Claiming, Allowance, Starter_Allowance,
  19. Claiming_Stakes, Maiden_Optional_Claiming, Invitational, Trials,
  20. Stakes, Maiden_Claiming, Allowance_Optional_Claiming, Handicap,
  21. Starter_Handicap, Starter_Optional_Claiming, Maiden_Stakes, Derby, Futurity
  22. } race_type;
  23.  
  24. typedef enum {
  25. main_turf, inner_dirt, timber_course, hurdle, equitrack,
  26. hunt, inner_turf, downhill_turf, steeple_chase, training_track, off_turf
  27. } track_surface;
  28.  
  29. typedef enum {
  30. Bute, Lasix, Adjunt_Medication, First_Time_Bute, First_Time_Lasix,
  31. Aluminum_Pads, Mud_Caulks, Inner_Rims, Goggles, Inserts, Flipping_Halter,
  32. Blocks, Blinker_Off, Nasal_Strip_Off, Nasal_Strip, Spurs, No_Shoes,
  33. Running_Ws, Shields, Blinkers, Glued_Shoes, Front_Bandages, Outer_Rims,
  34. Bar_Shoes, No_Whip, Pads, Turndowns, Queens_Plate, Tongue_Tie, Screens
  35. } horse_equipment_and_medication;
  36.  
  37. // ==========================================
  38. // DATA STRUCTURES
  39. // ==========================================
  40.  
  41. // 2. MUST DEFINE THIS BEFORE THE HORSE PERFORMANCE STRUCT
  42. struct horse_totals {
  43. int totals_onDirt;
  44. int totals_onTurf;
  45. int totals_onAllWeather;
  46. int totals_distance;
  47. int totals_onCurrentCourse;
  48. int total_starts;
  49. int total_wins;
  50. int total_places;
  51. int total_shows;
  52. };
  53.  
  54. struct race_details {
  55. struct date raceDate;
  56. int raceNumber;
  57. char trackName[50];
  58. char wagersAvailable[50];
  59. race_type raceType; // CHANGED: Now uses your custom race_type enum
  60. int numOfHorses;
  61. int raceDistance;
  62. int raceAgeRestriction;
  63. int raceRating;
  64. char raceHorseSexRestriction;
  65. track_conditions raceCondition;
  66. track_surface raceSurface;
  67. };
  68.  
  69. struct horse_details_and_past_performance {
  70. int programNumber;
  71. char horseName[50];
  72. char horseGender;
  73. char saddleColor[20];
  74. int morningLineOdds;
  75. int claimingPrice;
  76. int age;
  77. char horseColor[10];
  78. char sire[50];
  79. char dam[50];
  80. char jockeySilk[20];
  81. char horseJockey[50];
  82. char horseTrainer[50];
  83. char horseOwner[50];
  84. int carriedWeight;
  85. int daysUnraced;
  86. int finalOdds;
  87. int speedFigure;
  88. int postPosition;
  89. int finalPostion;
  90. struct horse_totals horse_stats; // Works perfectly now!
  91. };
  92.  
  93. // ==========================================
  94. // MAIN FUNCTION
  95. // ==========================================
  96. int main(void) {
  97. // FIXED: Renamed structure types to match your defined structures
  98.  
  99.  
  100. printf("Success! The code now compiles perfectly.\n");
  101. return (0);
  102. }
  103.  
Success #stdin #stdout 0s 5328KB
stdin
Standard input is empty
stdout
Success! The code now compiles perfectly.