Category "fgets"

Have to hit enter twice with fgets() in C?

Good Morning, I'm having an issue with some C code where I am forced to hit enter twice each time input is entered if the length of the input is less than the s

File reading in C with fgets entering into a never ending loop

I'm attempting to do basic file reading in C with fgets. It should read one line, pass it to the tokeniser function which should split it at every ' ' and add

I'm new to C and am stuck with many issues, I have fixed them but I wonder if there are better ways

I'm new to C just coming out of my second university class that explained structs and string functions. I tried running the code we had written in the lesson an

is there a way to use fgets size dynamically

So im learning about pointers and dynamic memory and how am experimenting with fgets. So i want to take in a string input into a pointer using fgets, but i want

why does malloc not taking in the full text? [duplicate]

Why is it when I try to take in a text in the variable is does not store in the full sentence. The malloc seems to not allocate enough memory