I have problem in push function. My code is
struct stack_t{
DATA_TYPE size;
DATA_TYPE top;
DATA_TYPE *arr;
}
void push(stack_t* s, DATA_TYPE item) {
if (is_full(s) == true ) {
exit(1);
}
else {
s->arr[++(s->top)] = item;
}
}
The line s->arr[++(s->top)] = item; has the error.(Bold part especially) It says read access error. I found that I have to write my code in address but I write my code in value. But I have no idea how to change my code. How I can express Struct array address?