+ 1
Help me solve this??
I am not getting what prblm is? https://code.sololearn.com/cce4OOoFOGQ2/?ref=app
1 Answer
+ 5
1) The ending braces of class should be at line 45 instead of 61.
So remove ' }; ' from line 61 and put it at line 45.
2) Since you made functions inside class, so you cannot access them directly in the main function. You need to create an object of the class then you can access its functions and members.
function f;
f.enqueue();
Same applies with other methods/functions.
Another way is by making all the methods static, then you don't need to create an object.
You can call function by referencing class.
function.enqueue();
3) Classes in C++ have private access specifier by default. Which means all class members and methods are private and you cannot access them outside of that class.
So specify the access specifier in your class, functions should be public in your case.