static public member function ( C++ )
<p>I need to count the times my public member function creates new data in a loop.
Each time data is read it is saved into a private member varaible. Nothing is overwritten.</p>

<pre><code>// my classType.h
const int ImpliedIndex = 1000;

class classType
{
private:
  char privateMember[ImpliedIndex];
  char privateMember2[ImpliedIndex];
public:
  static void myMemberCounter;
  void printMyInformation():
  void mySupplier(const char[] );
  ...
};

//classType.cpp
int globalCounter = 0;

void classType::printMyInformation()
{
   ...
   cout &lt;&lt; privateMember &lt;&lt; endl;
   cout &lt;&lt; globalCounter++ &lt;&lt; endl;
}
void classType::mySupplier( const char buff[] )
{
   strcpy( privateMember, buff );

}

// The main should clear things up a bit.
// main.cpp

int main()
{
    while ( !inFile.eof() )
    {   
        for ( int x = 0; x &lt; 20; x++ )
        {
       // do file I/O here
       // save each line of file into an temp array
       // supply temp array with a routine defined in myClass
       // re-use temp array until we run out of file
        }
    }    
//close file
</code></pre>

<p>I need to change my 20 to a variable. Notice that in classType I used globalCounter to retrieve the number of types.</p>

<p>What I wanted to do is, <code>globalCounter = memberCounter;</code></p>

<p>But I have to re-declare both of these varaibles, and I can't use <code>myClass[ImpliedIndex].memberCounter</code> with the assignment operator (=) or the binary insertion operator(&lt;&lt;).</p>
