title: How fscanf know this is the end of the line?
body: <p>I read string from file if the string in the file is:</p>
  
  <pre><code> "User1 User2 User3 User4 User5"
   "test1"
  </code></pre>
  
  <p>i want to read only the first line from the file,my code is:</p>
  
  <pre><code> if (in_fp != NULL)
   {
     while (fscanf(in_fp, "%s", &amp;user)!=EOF)
      {
        temp = (char*)malloc(sizeof user);
        strcpy(temp,user);
       }
   fclose (in_fp);
   }
  </code></pre>
  
  <p>but the problem is that fscanf read also that "test1" from the text file,i need to know how to make him to know that is the end of the line,what i need to fix in my code?
  <strong>i know about fgets</strong> but i want to read each user separately</p>