// File: cmatrix.h
// This header file contains the declaration for the CMatrix class. The class
// is used by the CScreen class to help fill the screen display with characters
// at random localtions.
// class declaration
CMatrix(int numRows, int numCols);
// member functions
void Fill(char dispChar, int msecs);
#endif // CMATRIX_H
and how can I declare a 2d with an unknown number of elements? The fill function is basically supposed to fill the screen with asterisks at random locations. and i have no idea how will they fill randomly
cmatrix.h -- This header file contains the declaration for the CMatrix class. The purpose of this class is to fill the screen with a character at random locations. If you look at the class declaration, you'll see that it only has two data members: one to store the total number of rows, and another to store the total number of columns. These data members are initialized by the class constructor, which receives those values in the parameter list.
Once the CMatrix object has been initialized, it's ready to have its CMatrix::Fill member function called. This function takes as input a character to draw, and a sleep interval to control the speed with which they're drawn. A loop is entered to draw the character to random locations on the screen, until all available locations have been used and the screen is completely filled. (Hmm... how will it keep track of available screen locations? How will it know when the screen has been completely filled?)