Code:

int k=0;
for(i=0; i<ARR_SIZE; i++)
{
while(k<ARR_SIZE){
if (guess[i] == secretNumber[k] && help[i] != 'S'){
help[i] = 'R';
break;
}
k++;
}
k=0;
for(j=0; j<=i-1; j++)
{
if(guess[i] == secretNumber[j])
{
help[i] = 'S';
}
}
if (help[i] != 'R' && help[i] != 'S')
help[i] = '_';
}
printf("help: ", help[i]);
for(i=0; i<ARR_SIZE; i++)
{
printf("%c ", help[i]);
}
}

Now, it will run 100%..... :-)

It will do _ RR_

And i don't know why it should produce _SS_

as you are replace R in case of right number but wrong place......

Okay, so i think you want something like......

Code:

int k=0;
for(i=0; i<ARR_SIZE; i++)
{
if (guess[i] == secretNumber[i] && help[i] != 'S'){
help[i] = 'R';
//break;
}
while(k<ARR_SIZE){
if(guess[i] == secretNumber[k])
{
help[i] = 'S';
break;
}
k++;
}
k=0;
if (help[i] != 'R' && help[i] != 'S')
help[i] = '_';
}
printf("help: ", help[i]);
for(i=0; i<ARR_SIZE; i++)
{
printf("%c ", help[i]);
}
}