Reactions to story from DaniWeb Blogs
Getting a constant conversion error
http://www.daniweb.com/ forums/ thread123445.html
I'm having a little problem with a conversion error during compile. Here is the code: #include <iostream> using namespace std; class costOfItem { public: costOfItem(float i_cost); void printMe(); private: const float price; }; // Free functions void displayPrice(costOfItem z) { z.printMe(); } void displayRefPrice(costOfItem &z) { z.printMe(); } void displayConstRef(const costOfItem &z) { z.printMe(); } Now in the last line it gives me the error cannot convert 'this' pointer from const costOfItem to costOfItem conversion loses qualifiers.
More rising blog posts
-
Entertainment »
Theater Hopper - May 16: Mister Handsome -
Business »
Goldman Sachs Pushes Up 2008 Oil Forecast To $141 -
Lifestyle »
Let your food rot in style in a shiny compost bin -
Politics »
Victory in the High Court over details of MPs expenses -
Sports »
New International Track and Field footage -
Technology »
Data Portability: Its The New Walled Garden
More rising news stories
-
Entertainment »
Genentech: Phase III Avastin colon cancer trial done by 2009 -
Business »
ECB's Trichet: 'No place for complacency' on price stability -
Lifestyle »
France Telecom brings Apple's iPhone to dozen new countries -
Politics »
Behind the Bush-Obama Smackfest -
Sports »
Report: Suns interview former NBA player Porter -
Technology »
Microsoft Joins Effort for Laptops for Children
Recent posts from DaniWeb Blogs
-
ORDER BY Multiple Columns
1 hour ago -
Stupid Error!!!
1 hour ago -
How to read integer from file in c++?
1 hour ago