Click to See Complete Forum and Search --> : Passing Class Array as pointer to function


April 21st, 1999, 01:10 PM
What is the best way to pass an instance of a class myclass[7] to a function as an arguement?

Michael Decker
April 21st, 1999, 01:27 PM
One way:

void YourFunction(myclass myClassArray[], int nElements);

April 27th, 1999, 09:09 AM
Example:

void MyFunction( CMyDialog *pDialog )
{
//function body
}

...

void CSomeWhere::Something()
{
CMyDialog MyDialog[10];

//Pass a class pointer to our function
MyFunction( &MyDialog[7] );
}