Added popping logic, trying
This commit is contained in:
parent
90fbfe67c3
commit
073cbbc45d
10
a1/program.c
10
a1/program.c
@ -196,22 +196,22 @@ if(*head != NULL){
|
||||
printf("Read: %sMissing closing brackets: ", buff);
|
||||
LinkedNode* ptr = *head;
|
||||
while(ptr){
|
||||
if(ptr->data == '['){
|
||||
char popped = pop(&ptr);
|
||||
if(popped == '['){
|
||||
putchar(']');
|
||||
|
||||
}
|
||||
if(ptr->data == '('){
|
||||
if(popped== '('){
|
||||
putchar(')');
|
||||
|
||||
}
|
||||
if(ptr->data == '{'){
|
||||
if(popped == '{'){
|
||||
putchar('}');
|
||||
|
||||
}
|
||||
if(ptr->data == '<'){
|
||||
if(popped == '<'){
|
||||
putchar('>');
|
||||
}
|
||||
ptr = ptr->next;
|
||||
}
|
||||
putchar('\n');
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user