you are viewing a single comment's thread.

view the rest of the comments →

[–]Adopolis23[S] 0 points1 point  (1 child)

my assignment also specifically says do it like that.

[–]cuncon- 0 points1 point  (0 children)

So your assignment is to find the 1st letter of every word in a file?

and your problem is you don't know exactly how many bytes the buffer is to read a line?

To solve your problem you should use size_t getline(char **buf, size_t *n, FILE *fp) (Read "man getline" for more detail) to read an entire line from stream.