+ 1

What is the meaning of this error??

I am creating an program for parenthesis matching in C using stack, but i am getting an error . https://code.sololearn.com/cPcXK5PIJoPY/?ref=app

26th Sep 2020, 6:12 AM
Vinayak Dutt
Vinayak Dutt - avatar
3 ответов
+ 3
Rei ,you are absolutely right. Vinayak Dutt , you are only declaring a pointer of type (struct stack), you have to make it point to something. Here is the fix👇 https://code.sololearn.com/cQZfTWLQEFlq/?ref=app
26th Sep 2020, 6:33 AM
Arsenic
Arsenic - avatar
+ 2
Thank you Arsenic and Rei
26th Sep 2020, 12:29 PM
Vinayak Dutt
Vinayak Dutt - avatar
+ 1
i'm not good with C but my guess is *sp is not pointing to any memory, so maybe do this struct stack *sp = malloc(sizeof(struct stack));
26th Sep 2020, 6:27 AM
Rei
Rei - avatar