What's wrong with using
i ?
the problem is that you're not resetting the value of cosik when you go back through the
while loop.
A simple adjustment:
void itmmenu()
{
int i;
int cosik;
while(!b2)
{
cosik=0; // ADD THIS HERE!!!
render();
for(i=0;i<8;i++)
{
if(ilosc[i]>0)
{
printstring(10,10+10*cosik,screen,0,name[i]);
printstring(100,10+10*cosik,screen,0,str(ilosc[i]));
cosik++;
}
}
showpage();
}
}
However using
cosik is rather pointless because
i is doing the same thing, judging from your code this is a mere display and isn't for any data manipulation.