| | |
Need help solving errors: C2533, C2511, C2144.
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2008
Posts: 20
Reputation:
Solved Threads: 0
oh. sorry. I'm just really trying to get this done in time. I had 5 due tonight (with only 1 1/2 weeks to do them) and I only have 3 completely finished. The last one isn't getting done because I don't have time to type the code up and then compile it and debug. So I need this one to be as good as it can...
sorry about that...
sorry about that...
The print() method doesn't need a parameter at all.
This time read all the code and correct the spelling as I did.
Invoice.cpp
invoice.h
main.cpp
This time read all the code and correct the spelling as I did.
Invoice.cpp
C++ Syntax (Toggle Plain Text)
void Invoice::print() { //print values in current bill cout<<"Invoice Number: "<<getInvoiceNum()<<endl<<endl; cout<<"Part Number: "<<getPartNum()<<endl; cout<<"Part Description: "<<getPartDesc()<<endl; cout<<"Quantity Shipped: "<<getQuantityShip()<<endl; cout<<"Unit Price ($/item): "<<getUnitPrice()<<endl; cout<<"Sales Tax Rate: "<<getSalesTaxRate()<<endl; cout<<"Sales Tax Amount: "<<calcSalesTaxAm()<<endl; cout<<"Shipping Cost: "<<getShipCost()<<endl; cout<<"Total Cost: "<<calcTotCost()<<endl; }
invoice.h
C++ Syntax (Toggle Plain Text)
void print();
main.cpp
C++ Syntax (Toggle Plain Text)
if (bill[place].getInvoiceNum() == inum)
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
Join Date: Dec 2008
Posts: 20
Reputation:
Solved Threads: 0
Thanks for replying and all the help you've given me thus far!
Well, when I do that I get 9 occurrences of the same error - one per line.
c:\documents and settings\tina\my documents\visual studio 2008\projects\csci112lab4\csci112lab4\invoice.cpp(114) : error C2662: 'Invoice::getInvoiceNum' : cannot convert 'this' pointer from 'const Invoice' to 'Invoice &'
Conversion loses qualifiers
Well, when I do that I get 9 occurrences of the same error - one per line.
c:\documents and settings\tina\my documents\visual studio 2008\projects\csci112lab4\csci112lab4\invoice.cpp(114) : error C2662: 'Invoice::getInvoiceNum' : cannot convert 'this' pointer from 'const Invoice' to 'Invoice &'
Conversion loses qualifiers
•
•
Join Date: Dec 2008
Posts: 20
Reputation:
Solved Threads: 0
Ok, fixed that one. That was my fault for not checking my code exactly. I left const in the .h file.
But...now I'm back to that blasted C2511 error.
c:\documents and settings\tina\my documents\visual studio 2008\projects\csci112lab4\csci112lab4\invoice.cpp(113) : error C2511: 'void Invoice::print(void) const' : overloaded member function not found in 'Invoice'
c:\documents and settings\tina\my documents\visual studio 2008\projects\csci112lab4\csci112lab4\invoice.h(14) : see declaration of 'Invoice'
But...now I'm back to that blasted C2511 error.
c:\documents and settings\tina\my documents\visual studio 2008\projects\csci112lab4\csci112lab4\invoice.cpp(113) : error C2511: 'void Invoice::print(void) const' : overloaded member function not found in 'Invoice'
c:\documents and settings\tina\my documents\visual studio 2008\projects\csci112lab4\csci112lab4\invoice.h(14) : see declaration of 'Invoice'
![]() |
Other Threads in the C++ Forum
- Previous Thread: C++ graphics
- Next Thread: Inheritance, and code not running
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamiccharacterarray email encryption error file format forms fstream function functions game givemetehcodez graph homeworkhelp iamthwee ifstream input int java lib library lines list loop looping loops map math matrix memory newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search simple sorting spoonfeeding string strings struct temperature template templates text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






