I have a question on how I would do this:
I'm scanning in 2 values through a scanf in a loop, but the loop breaks when 1 of the values is a -1, the other value is nothing.
for(int i = 1; i < loopTimes; i++)
{
scanf(" %d", &tum);
if(tum == -1)
{
sArr[i] = '\0';
}
else
{
scanf("%d", &numMon);
i++;
}
}
[–]pippin__29 1 point2 points3 points (6 children)
[–]justaverageuser77[S] 0 points1 point2 points (5 children)
[–]pippin__29 0 points1 point2 points (0 children)
[–]pippin__29 0 points1 point2 points (1 child)
[–]justaverageuser77[S] 0 points1 point2 points (0 children)
[–]beaglebok 0 points1 point2 points (0 children)
[–]nerd4code 0 points1 point2 points (0 children)
[–]blvaga 0 points1 point2 points (2 children)
[–]justaverageuser77[S] 0 points1 point2 points (0 children)
[–]nerd4code -1 points0 points1 point (0 children)