title: error: variable or field declared void
body: <p>This is actually the program my instructor had provided with us to work with, i had to make several changes thus far to get it to at least compile:</p>
  
  <pre><code> #include &lt;dirent.h&gt;
  #include &lt;errno.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;cctype&gt;
  #include &lt;cstdio&gt;
  #include &lt;string&gt;
  #include &lt;list&gt;
  
  using namespace std;
  std::string makeString();
  std::string path= "/";
  DIR*dirp;
  struct dirent*direntp;
  std::list&lt;string&gt; child_directories;
  
  
  
  void dir_traverse(&amp;path, ios::out){
      list&lt;string&gt; child_directories;
      DIR*dirp = opendir(path.data());
      struct dirent*dir_entry = readdir(dirp);
          while(dir_entry !=null){ 
               unsigned char d_type = dir_entry-&gt;d_type==DT_OIR?'D' : 'R';
               if(d_type == 'D'){ 
                  if(dir_entry-&gt;d_name[0]!= '.')
                      {
                      child_directories push_back(dir_entry_d_name);
                  }
  
               }
              out&lt;&lt;'\t'&lt;&lt;d_type&lt;&lt;":"&lt;&lt;dir_entry-&gt;d_name&lt;&lt;endl;
              dir_entry= readdir(dirp);
          }
          list&lt;string&gt;::iterator it = child_directories.begin();
          while(it! = child_directories.end())
              {
                  dir_traverse(&amp;path + "/" + *it, out);
                  it++;
              }
          closedir(dirp);
  }
  </code></pre>
  
  <p>I get the error I have as the title in reference to the dir_traverse function. I am pretty much interested in figuring out what is causing the problem and why. Half of what is going on in the function I don't really get at the moment, which is probably why I am having this compiling issue. just not up to speed on c/c++ yet :)</p>
  
  <p>thanks</p>
  
  <p>edit:</p>
  
  <pre><code>void dir_traverse(string&amp; path, ostream&amp; out){
      list&lt;string&gt; child_directories;
      DIR*dirp = opendir(path.data());
      struct dirent*dir_entry = readdir(dirp);
          while(dir_entry !=NULL){ 
               unsigned char d_type = dir_entry-&gt;d_type==DT_DIR?'D' : 'R';
               if(d_type == 'D'){ 
                  if(dir_entry-&gt;d_name[0]!= '.')
                      {
                      child_directories.push_back(dir_entry_d_name);
                  }
  
               }
              out&lt;&lt;'\t'&lt;&lt;d_type&lt;&lt;":"&lt;&lt;dir_entry-&gt;d_name&lt;&lt;endl;
              dir_entry= readdir(dirp);
          }
          list&lt;string&gt;::iterator it = child_directories.begin();
          while(it != child_directories.end())
              {
                  dir_traverse(&amp;path + "/" + *it, out);
                  it++;
              }
          closedir(dirp);
  }
  </code></pre>