typedef struct { int hash[4]; } ParkingSystem; ParkingSystem* parkingSystemCreate(int big, int medium, int small) { ParkingSystem* obj=(ParkingSystem*)calloc(sizeof(ParkingSystem),1); obj->hash[1]=big; obj->hash[2]=medium; obj->hash[3]=small; return obj; } bool parkingSystemAddCar(ParkingSystem* obj, int carType) { return (obj->hash[carType]-->0)?true :false; } void parkingSystemFree(ParkingSystem* obj) { free(obj); }