Need help solving errors: C2533, C2511, C2144.

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2005
Posts: 15,454
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1476
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Need help solving errors: C2533, C2511, C2144.

 
0
  #11
Dec 4th, 2008
>>'getShippingCost' is not a member of 'Invoice'

Yes -- you didn't see the code I posted earlier?
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 20
Reputation: acperson is an unknown quantity at this point 
Solved Threads: 0
acperson acperson is offline Offline
Newbie Poster

Re: C2511 error - need help solving

 
0
  #12
Dec 4th, 2008
I have tried changing them. it backfires every time. is there any way I could supply an explicit conversion?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,454
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1476
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Need help solving errors: C2533, C2511, C2144.

 
0
  #13
Dec 4th, 2008
Don't create two threads about the same problem. I merged your two threads and don't intend to do it again!
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 20
Reputation: acperson is an unknown quantity at this point 
Solved Threads: 0
acperson acperson is offline Offline
Newbie Poster

Re: Need help solving errors: C2533, C2511, C2144.

 
0
  #14
Dec 4th, 2008
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...
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 20
Reputation: acperson is an unknown quantity at this point 
Solved Threads: 0
acperson acperson is offline Offline
Newbie Poster

Re: Need help solving errors: C2533, C2511, C2144.

 
0
  #15
Dec 5th, 2008
Originally Posted by Ancient Dragon View Post
>>
Yes -- you didn't see the code I posted earlier?
Is this in response to supplying an explicit conversion? Because if so, I'm still doing something else wrong because i have the same thing in the code box you provided.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,454
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1476
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Need help solving errors: C2533, C2511, C2144.

 
0
  #16
Dec 5th, 2008
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
  1. void Invoice::print()
  2. { //print values in current bill
  3. cout<<"Invoice Number: "<<getInvoiceNum()<<endl<<endl;
  4. cout<<"Part Number: "<<getPartNum()<<endl;
  5. cout<<"Part Description: "<<getPartDesc()<<endl;
  6. cout<<"Quantity Shipped: "<<getQuantityShip()<<endl;
  7. cout<<"Unit Price ($/item): "<<getUnitPrice()<<endl;
  8. cout<<"Sales Tax Rate: "<<getSalesTaxRate()<<endl;
  9. cout<<"Sales Tax Amount: "<<calcSalesTaxAm()<<endl;
  10. cout<<"Shipping Cost: "<<getShipCost()<<endl;
  11. cout<<"Total Cost: "<<calcTotCost()<<endl;
  12. }

invoice.h
  1. void print();

main.cpp
  1. 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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 20
Reputation: acperson is an unknown quantity at this point 
Solved Threads: 0
acperson acperson is offline Offline
Newbie Poster

Re: Need help solving errors: C2533, C2511, C2144.

 
0
  #17
Dec 5th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,688
Reputation: Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all 
Solved Threads: 265
Lerner Lerner is offline Offline
Posting Virtuoso

Re: Need help solving errors: C2533, C2511, C2144.

 
0
  #18
Dec 5th, 2008
in main you call print() on an Invoice object just like you call getInvoiceNum() or one of the other plublic methods.

bill[place].print();

assuming you've changed the print() method to have a void parameter list.
Klatu Barada Nikto
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 20
Reputation: acperson is an unknown quantity at this point 
Solved Threads: 0
acperson acperson is offline Offline
Newbie Poster

Re: Need help solving errors: C2533, C2511, C2144.

 
0
  #19
Dec 5th, 2008
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'
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,688
Reputation: Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all 
Solved Threads: 265
Lerner Lerner is offline Offline
Posting Virtuoso

Re: Need help solving errors: C2533, C2511, C2144.

 
0
  #20
Dec 5th, 2008
Did you update the declaration of print() in the .h file and the definition of print() in the .cpp file to correspond with the new signature of print()?
Klatu Barada Nikto
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC