title: error: request for member which is of non class type
body: <p>I am using forward declaration and now I am getting an error referring to the class that uses the forward declaration...so fInstance forward declares fConfig and then the Helper class (a namespace - used for global access to functions) - getting t</p>
  
  <p><strong>fConfig.h</strong></p>
  
  <pre><code>#ifndef FCONFIG_H
  #define FCONFIG_H
  
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;iostream&gt;
  #include &lt;sstream&gt;
  #include &lt;string&gt;
  #include &lt;cstring&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;fcntl.h&gt;
  #include "JWDSFork.h"
  //#include "fInstance.h"
  
  using namespace std;
  
  class fConfig
  {
      private:
          pid_t pid, w;
  
      public:
          pid_t cPid;
          string name;
  
          int group;
          int instanceId;
          int numInstance;
          int tries;
  
          bool reply;
          bool debug;
          bool service;
          bool currentlyRunning;
  
          time_t startTime;
          time_t endTime;
  
          string path;
  
          fConfig();
          virtual ~fConfig();
  
          void start();
          string intToString(int);
          char* stringToChar(string);
  };
  
  #endif // FCONFIG_H
  </code></pre>
  
  <p><strong>fInstance.h</strong></p>
  
  <pre><code>#ifndef FINSTANCE_H
  #define FINSTANCE_H
  
  //#include "fConfig.h"
  #include &lt;vector&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  class fConfig;
  
  
  class fInstance
  {
  public:
  
      fConfig* config;
      pid_t pid;
      vector&lt;string&gt; notes;
      vector&lt;time_t&gt; times;
  
      fInstance();
      virtual ~fInstance();
  
  
  };
  
  #endif // FINSTANCE_H
  </code></pre>
  
  <p><strong>Helper.h</strong>    </p>
  
  <pre><code>#ifndef HELPER_H
  #define HELPER_H
  
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;cstring&gt;
  #include &lt;vector&gt;
  #include &lt;sstream&gt;
  #include &lt;limits.h&gt;
  #include "fInstance.h"
  
  using namespace std;
  
  namespace Helper
  {
      extern string APPDIR;
  
      bool errorCheck(int, char*);
      string charToString(char*, int);
      string longToString(unsigned long);
      bool Contains(vector&lt;fInstance&gt;, fInstance);
      string convertInt(int);
      string convertDouble(double);
      bool Read(int, char*, size_t);
      bool Write(int, char*, size_t);
  };
  
  #endif // HELPER_H
  </code></pre>
  
  <p><strong>Helper.cpp</strong></p>
  
  <pre><code>//Helper.cpp - function that causes a problem
  #include "Helper.h"
  namespace Helper
  {
  
  bool Contains(vector&lt;fInstance&gt; a, fInstance b)
      {
          for(unsigned int i= 0; i &lt; a.size(); i++ )
          {
              if(a[i].config.name == b.config.name)
              {
                  return true;
              }
          }
  
          return false;
      }
  }
  </code></pre>
  
  <p>I am getting these errors</p>
  
  <pre><code>error: request for member ‘name’ in ‘a.std::vector&lt;_Tp, _Alloc&gt;::operator[] [with _Tp = fInstance, _Alloc = std::allocator&lt;fInstance&gt;](((long unsigned int)i))-&gt;fInstance::config’, which is of non-class type ‘fConfig*’
  </code></pre>