title: Check if item on directory is folder in C
body: <p>i'd like to check when I go over all files on directory, if one of the files/items on the directory is folder (another directory)</p>
  
  <p>code I have started from (using dirent.h):</p>
  
  <pre><code>DIR *dir;
  struct dirent *ent;
  if ((dir = opendir ("c:\\src\\")) != NULL) {
    /* print all the files and directories within directory */
    while ((ent = readdir (dir)) != NULL) {
      if (ent.is_folder()) // here is what I want to implement
        printf ("Folder: %s\n", ent-&gt;d_name);
      else
        printf("File %s\n", ent-&gt;d_name);
    }
    closedir (dir);
  } else {
    /* could not open directory */
    perror ("");
    return EXIT_FAILURE;
  }
  </code></pre>