2D Stocks

With 2D arrays, we can now group together all of the same type data arrays into a single data structure. In our case, we can group all the integer fields into a 2D array called folio. Each row of the structure represents the information for one stock, and the columns of the array represent the fields.
       int folio[MAX_STOCKS][MAX_COLS];

We can declare this array in main() in stock10.c. I have defined macros for the indexes of the columns corresponding to the fields of the data base in folio10.h.

We must rewrite all of the code for the functions, using the same algorithm, but using the syntax for accessing the 2D array. These are in io_utils10.c, and proc_folio10.c.


[up] to Overview.