passing a class arguement to a function?

Hello. I am in the process of trying to write the Game of Life for my programming class. How do I pass a class as an arguement to another function?? In the code below I want to pass the class in the nextGeneration function so that I can access those public members. Thanks.

int main()
{
int row;
int col;
ifstream inData;


boolMatrix grid;


inData.open("test.txt");

while (inData)
{
inData >> row >> col;
grid.set(row, col, true);
}
grid.print();

nextGeneration();



system("pause");

}


void nextGeneration()
1
2
3
4
5
6
7
8
9
10
11
12
void nextGeneration(boolMatrix& grid)
{
  grid.doStuff();
}

//........

int main()
{
  //...
  nextGeneration( grid );
}
Thanks for the help Disch. You guys are awesome here.
Topic archived. No new replies allowed.