All pastes #280516 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-12-15 23:28 UTC
rendered paste body
struct s
{
	int id;
	int count;
};

s stats[1000];

void addclient(int id)
{
	int i;
	
	for(i=0; i < 1000; i++)
	{
		if(stats[i].id == id)
		{
			stats[i].count++;
			return;
		}
	}

	for(i=0; i < 1000; i++)
	{
		if(stats[i].id == 0)
		{
			stats[i].count = 1;
			return;
		}
	}
}