Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

cant get this code to run in microsoft visual C++ 2010 -------------------------

ID: 3647717 • Letter: C

Question


cant get this code to run in microsoft visual C++ 2010
-----------------------------------------------------





#include<iostream>

int main()

{

struct node

{

char m[];

node *next;

}start;

class list

{

char *ch;

int rear,front,max;

list(int size)

{

max=size;

ch=new char[max];

rear=front=-1;

}

~list()

{

delete[] ch;

}

bool isEmpty()

{

if(((rear== -1) && (front== -1)) || (front>rear))

return true;

else return false;

}

bool isFull()

{

return rear==max-1;

}

void insertFront(char &m)

{

if(isFull())

cout<<"Overflow";

else if((rear== -1) && (front== -1))

front=0;

rear=0;

else

{

while(ch[front]!=ch[front+1])

{



ch[rear+1]=ch[rear];

rear=rear+1;

}

ch[front]=m;

}

}

void insertRear(char &m)

{

if(isFull())

cout<<"Overflow";

else

{

if((rear== -1) && (front== -1))

front=0;rear=0;

else

rear=rear+1;

ch[rear]=m;

}

}

char remove()

{

if(isEmpty())


{

cout<<"underflow";

return 0;

}

else

{

char x=ch[front];

front=front+1;

return x;

}

}

}

Explanation / Answer

its has following errors In function 'int main()': Line 12: error: ISO C++ forbids zero-size array 'm'

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote