+ 1
[CPP] Project Problem
Hello, In this project we have to use operation overloading to add two queue objects. I am getting an error that “operator+ is not declared as a function”. Please let me know where I made a mistake. My code starts at line 41 till before the main function declaration. https://code.sololearn.com/cMDq2f6YMNKJ/?ref=app
2 Réponses
+ 1
Function declaration for overload operator is wrong..
Use this :
Queue operator+(Queue &q){
Other errors tempArr, obj are undeclared..
You mean 'q' for 'obj' may be..!!
Hope you can correct all simply..
Hope it helps..
edit:
Queue operator+(Queue &obj){
will fix the issue.
remove 'u'
declare tempArr
+ 1
That helped me to fix the code. Thank you