then
for(i = 0; i < 4 ;i++)
{
if(slot[i])
{
char spot[4];
sprintf(spot, "P%d,", i);
strcat(str, spot);
}
}
then
for(i = 0; i < 4 ;i++)
{
if(slot[i])
{
char spot[4];
sprintf(spot, "P%d,", i);
strcat(str, spot);
}
}