title: Linux C read file line by line
body: <p>How to code a read file line by line in linux C?</p>
  
  <p>In windows C++ I use ifstream.</p>
  
  <p>I dont know about linux, please advice?</p>
  
  <p>Okay chill out guys, don't down so much.</p>
  
  <p>here is the code:</p>
  
  <pre><code>char fpath = "file.txt";
  char names;
  FILE *fp;
  
  ifstream fs(fpath);
  
  while (fs &gt;&gt; names)
  {
    // here is some buffer to send to a server.
  }
  </code></pre>
  
  <p>So here I need to read each line from file.txt and send each of those to a server.</p>