0
do u know how can i debug this code and whats the compiler's error?? i can not understand the errors i recieved in codeblocks an
#include <iostream> using namespace std; class q { private: char a[3]; int front , rear; public: void set (void); void insert(char); char remove(void); }; void q::set(void){ front=0; rear=0; } void q::insert(char ch) { if (rear==2){cout<<"ful"; return;} rear++; a[rear]=ch; } char q::remove(void) { if(front==rear) {cout<<"empty";return 0;} front++; return a[front]; } int main() { q ob; ob.set(); ob.insert('A'); ob.insert('B'); cout<<ob.remove();}
6 odpowiedzi
+ 1
on line 35 change
{if (rear==2){cout<<"ful"; return;}
into
if (rear==2){cout<<"ful"; return;}
+ 1
yes guys after removing extra { from all if conditionals the errors disapeared.
0
Remove the extra { in line 34.
0
thanks for that point but even after remove the { that and ... the errors are in their own place ,
0
this is the compiler's error: qualified-id in declaration before '(' token in line 43