Sorry bout that..
Here is part of my code
Code:
while (fgets(read_line, 100, in) != NULL)
{
for (i=0; i<strlen(read_line); i++)
{
/* i think my logic here is wrong */
if ((read_line[i] == '-') && (read_line[i+1] == '-'))
{
ptr = strtok(read_line, "--");
}
}
ptr = strtok(read_line, "\n");
while(ptr != NULL)
{
strcpy(line, ptr);
fprintf(out, "%s\n", line);
ptr = strtok(NULL, "\n");
}
}
For Example:
Read in input are:
abc abc-abb -- bbb aaa eee
Output should be:
abc abc-abb
but my output is:
abc abc