Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

what the mistake in my code #include #include using namespace std; struct NODE { int info; struct NODE *next; }; struct NODE *TOP = NULL;

what the mistake in my code

#include #include using namespace std; struct NODE { int info; struct NODE *next; };

struct NODE *TOP = NULL; void PUSH (int item)

{ struct NODE *NewNode; NewNode = new (NODE); // Creates NODE and store its address into NewNode if(NewNode==NULL) { coutinfo = item; NewNode->next = TOP; TOP=NewNode;

} int POP () { int item = TOP -> info; T=TOP; TOP = TOP->next; delete T; // it release the memory of deleted NODE return item; } int PEAK () { return (TOP -> info); } void TRAVERSE () { struct NODE *T; For( T=TOP ; T!=NULL ;T=T->next) coutinfo

int main () { struct NODE *T;

int item, choice; while(1) {

cout "; cin>> choice; switch(choice) { case 1: cout>item; PUSH(item); break; case 2: if(IsEmpty()) {cout

image text in transcribed

In function 'int POPO': [Error] 'T' was not declared in this scope [Error] type '' argument given to 'delete', expected pointer In function 'void TRAVERSEOS: [Error] expected ')' before ';' token [Error] expected ;' before ')' token recipe for target 'lab5.o' failed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

Students also viewed these Databases questions

Question

What is Accounting?

Answered: 1 week ago

Question

Define organisation chart

Answered: 1 week ago

Question

What are the advantages of planning ?

Answered: 1 week ago

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago