how to write c code function implementing the first heuristic algorithm

void binpack_firstfit(int item)
{
	int s = 0;
	int bin_Value;
	do{
		bin_Value = bins[s];
		if (bin_Value + item < BIN_VOLUME){
		bins[s] = bin_Value + item;
		s = NUM_BINS;
		}
		}while(s++ < NUM_BINS);

}

> how to write c code function implementing the first heuristic algorithm
That does look like C code, what's the question?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.