title: Use of getdelim
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  main() {
    FILE *fp;
    char *lineptr = NULL;
    size_t len;
    size_t read;
    fp = fopen(&quot;test.txt&quot;, &quot;r&quot;);
  
    if(NULL == fp) {
      exit(1);
    }
  
    while((read = getdelim(&amp;lineptr, &amp;len, 33, fp)) != -1) {
      printf(&quot;%s&quot;, lineptr);
    }
  
    free(lineptr);
  }
  </code></pre>
  <p>In <code>test.txt</code> I have written:</p>
  <pre><code>before giving tab !after tab has been given
  </code></pre>
  <p>I have set <code>!</code> as the delimiter but I don't see any difference between <code>getline</code> and <code>getdelim</code> in <code>getdelim</code> I can set the delimter but in case of <code>getline</code> it is newline character, I want the o/p to be:</p>
  <pre><code> before giving tab
   after tab has been given
  </code></pre>
  <p><code>!</code> should be taken as delimiter. How can I do this using <code>getdelim</code>?</p>