home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
c
/
cnews016.arc
/
SETS.ARC
/
SETSOURC.ARC
/
SETMECNT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-03-09
|
619b
|
29 lines
#include <stdio.h>
#include <stdarg.h>
#include "sets.h"
/***************************************************************************/
int set_member_count(set *aset)
/***************************************************************************/
/* Returns the number of members in a set */
{
int i,j,k;
unsigned w;
k = 0;
/* go through the member records and count the '1' bits */
for(i=0;i<aset->member_recs;i++)
{
w = 1;
for(j=0;j<MEMBERS_PER_WORD;j++)
{
if((aset->word[i] & w) > 0)
k++;
w = w << 1;
}
}
return k;
} /* end set_member_count */