46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
*/
struct Bag {
int cnt; /* Number of integers in the bag */
int sz; /* Number of slots in a[] */
int used; /* Number of used slots in a[] */
int *a; /* Hash table of integers that are in the bag */
};
#endif
/*
** Initialize a Bag structure
*/
void bag_init(Bag *p){
memset(p, 0, sizeof(*p));
|
>
>
>
>
>
|
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
*/
struct Bag {
int cnt; /* Number of integers in the bag */
int sz; /* Number of slots in a[] */
int used; /* Number of used slots in a[] */
int *a; /* Hash table of integers that are in the bag */
};
/*
** An expression for statically initializing a Bag instance, to be
** assigned to Bag instances at their declaration point.
*/
#define Bag_INIT {0,0,0,0}
#endif
/*
** Initialize a Bag structure
*/
void bag_init(Bag *p){
memset(p, 0, sizeof(*p));
|