Code:
if(isspace(*i))
{
if(!ready)
{
continue;
}
else ready = FALSE;
}
else ready = TRUE;
There is no need for the continue.
Code:
ready = isspace(*i) ? FALSE ? TRUE;
Or drawn out...
Code:
if( isspace(*i) )
ready = FALSE;
else
ready = TRUE;
There really is no need to check the ready state once you do the isspace() check, since either way, if it is a space, ready gets set to FALSE. So just do it in one step.
Speed wise, this is probably faster anyway:
Code:
check isspace
check ready state
continue
else check ready state
ready = FALSE
else isspace
ready = TRUE;
1 check 1 assignment OR 2 checks 1 assignment
Versus:
Code:
check isspace
ready = FALSE
else isspace
ready = TRUE
1 check, 1 assignment every time through.
Quzah.