So I have a header file and a library with functions and in the header it declares
typedef struct board *board;
Now I have to use the functions from the header:
board create_board(int rows, int cols);
void cell_on(board b, int r, int c);
int display_board(board b);
void delay(int msec);
So in my program I:
Code:
#include "board.h"
int main(void){
board b;
create_board(24, 80);
cell_on(b, 2, 2);
display_board(b);
delay(2000);
return 0;
}
And I am getting a segmentation fault. So I know something is wrong with me using b in the functions. Could anyone help? Thanks