title: Scan whole line from file in C Programming
body: <p>I was writing a program to input multiple lines from a file.
  the problem is i don't know the length of the lines, so i cant use fgets cause i need to give the size of the buffer and cant use fscanf cause it stops at a space token
  I saw a solution where he recommended using malloc and realloc for each character taken as input but i think there's an easier way and then i found someone suggesting using </p>
  
  <pre><code>fscanf(file,"%[^\n]",line);
  </code></pre>
  
  <p>Does anyone have a better solution or can someone explain how the above works?(i haven't tested it)</p>
  
  <p>i use GCC Compiler, if that's needed </p>