title: how can i get all file name in a directory without getting "." and ".." in C
body: <p>I am working with Linux system.</p>
  
  <pre><code> DIR *dir;
    struct dirent *ent;
    while ((ent = readdir (dir)) != NULL) {           
      printf ("%s\n", ent-&gt;d_name);
    }
  </code></pre>
  
  <p>I get <code>"."</code> , <code>".."</code> and some file names as a result. 
  How can I get rid of <code>"."</code> and <code>".."</code>? 
  I need those file names for further process. 
  What's the type of <code>ent-&gt;d_name</code>?? Is it a string or char?</p>