There is no function in C that lets you read an arbitrary amount of input from a stream.
Functions like fscanf require an input buffer. That buffer needs to be memory you allocate, either with malloc or on the stack. And if the input is bigger than the buffer...well...bad things can happen.
You can limit how many characters fscanf reads by tweaking the format specifier. That will prevent buffer overflow errors, but it creates a problem: if the format specifier says to read no more than 100 characters, but there are 200 characters to read, then you need to detect that, increase the size of your buffer, and read the rest of the characters...up to your new buffer limit.
You could also just read 1 char at a time, and put it in your buffer (until you hit the end of whatever character). Again, if you fill the buffer, you need to allocate a bigger one (realloc works well for this), and continue the process.
Yes, it's harder than it needs to be. One of many, many reasons why C sucks. (or, at least...why C isn't a 'modern' programming language. Every modern programming language provides a simple [it's a 1 liner] solution to this problem).
Your variable named string MUST point to a buffer that is big enough to hold everything you ask for, or you will crash. It's that simple.