Added popping logic, trying

This commit is contained in:
Anton Dolozin 2025-10-13 18:02:28 +02:00
parent 90fbfe67c3
commit 073cbbc45d

View File

@ -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;