Read only first word of line from line with $fscanf()

In reply to Vaino:

Just %s is sufficient in this case.


$fscanf(fd, "%s", str); // Read from line start till encountering a whitespace.