Code:
/* Re-Arrangement */
p = strtok(code, delimitor);
strncpy(output, p, 1);
while(1)
{
/* advance each token and split first char onto new string */
p = strtok( NULL , delimitor );
if( p != NULL )
strcat(output, strncpy(temp, p, 1));
else
break;
}
printf(output);
I've altered the code so it executes without error however the output is gibberish.
NeܾÜÉ·'wܾÜÉ·'tܾÜÉ·'IܾÜÉ·'sܾÜÉ
etc....
The first few letters should be New etc, why is this happening.
The following is the original input.
News eight weather tonight: Increasing snow. Unexpected precipitation smothers eastern towns. Be extremely cautious and use snowti
res especially Heading east. The highway is not knowingly slippery. Highway evacuation Is suspected. Police report emergency situations in downtown ending near
tuesday.