Code:
for(j = 0; j< 255; j++)
{
	if(!string[j])
	{
		count = j;
		j = 254;
	}
}
something like this...
I am kinda tired right now so don't expect much, anyway this is for the count portion.