/*fill a m x n grid with 0 or 1 */
I'm trying to return a pointer to the cell on the grid but I'm not getting the correct output..please help me figure out what I'm doing wrong.
Code:
typedef enum
{
a,
b
} cell_alpha;
Code:
typedef struct
{
int rows;
int columns;
/* Pointer to the beginning of the grid cell data where the cells are in a row-major layout */
cell_alpha * cells;
} grid;
need help with the following code:
Code:
cell_alpha * abc_cell(grid * present_grid, int row, int column)
{
return &cell_alpha *(row*(grid->rows)+column); /*! Return a pointer to the corresponding cell on the grid. */
}