title: How can i get the listing of files and directories of a path using C++?
body: <p>I am using the directory class to get this information but unable to assign this data to a data member of my own class. i am doing an oop project. Furthermore,I want to use the concept of Dynamism(containment).I have created two class, mydirectory and myfiles as under:</p>
  
  <pre><code>class files
  {
      string fname[25];
  public:
      files()
      {
        fname=NULL;
      }
  
  };
  
  class directory
  { private:
      directory *d;
      string *dname[25];   //* to show there may be a subdirectory,there may be not.
      files *ff[25];       // data member string *fname[25];
  int numd,numf;
  public:
      directory()
      {
      numd=0;numf=0;
      }
  </code></pre>
  
  <p>Now when if I want to use the statment:</p>
  
  <pre><code> Directory::GetDirectories("D:\\"); 
  </code></pre>
  
  <p>how can I assign the directory names to "dname" of directory class.</p>
  
  <p>I dont want to include a third party software.</p>
  
  <p>also i need help on the topic: how can a file (doc file/pdf/txt/pwt etc) can be opened from c++ code outside the console? I am very worried. please help me. thanks in advance.</p>
  
  <p>I am new to c++ so please forgive if there are any errors in pointer handling, as I am doing this containment for the first time. I also need some reading stuff.</p>