title: What does %[^\n] mean in C?
body: <p>What does <code>%[^\n]</code> mean in C? 
  I saw it in a program which uses <code>scanf</code> for taking multiple word input into a string variable. I don't understand though because I learned that scanf can't take multiple words.</p>
  
  <p>Here is the code: </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main() {
      char line[100];
      scanf("%[^\n]",line);
      printf("Hello,World\n");
      printf("%s",line);
      return 0;
  }
  </code></pre>