error C2446: '==' : no conversion from 'int' to 'int (__thiscall CNGMiniMart::*)(void)'
error C2040: '==' : 'int (__thiscall CNGMiniMart::*)(void)' differs in levels of indirection from 'int'
... you like croco bak gua?Originally posted by sgboy2004:it means u hav a compiled error
Originally posted by sgboy2004:it means u hav a compiled error
Compiling...
CNGMiniMart.cpp
c:\documents and settings\ito\my documents\graveyard\cngminimart\cngminimart\cngminimart.cpp(85) : error C2446: '==' : no conversion from 'int' to 'int (__thiscall CNGMiniMart::*)(void) const'
There are no conversions from integral values to pointer-to-member values
c:\documents and settings\ito\my documents\graveyard\cngminimart\cngminimart\cngminimart.cpp(85) : error C2040: '==' : 'int (__thiscall CNGMiniMart::*)(void) const' differs in levels of indirection from 'int'
Error executing cl.exe.
wad u mean? the function should declared constant? i did dat le.. nothing.Originally posted by sgboy2004:u should not be using Croco as a variable declaration...it should be a variant constant
Both int wad!!?Originally posted by Seals:Variables equated are not of the same type.
//Got error here.
for(i = 0; i < objCount; i++) {
if (stockObj[i].getItemCode == itemCode) {
qtyAvail = stockObj[i].getQty();
if(qtySold <= qtyAvail) {
if(qtySold > 10)
switch(stockObj[i].getInventGroup()) {
case 0:
break;
case 1:
unitPrice = unitPrice * 0.98;
break;
case 2:
unitPrice = unitPrice * 0.96;
break;
case 3:
unitPrice = unitPrice * 0.94;
break;
}
// Item logging code here.
break;
}
else
cout << "\nThere are not enough stock, please replenish items.\n";
}
}
cout << "\n\n\n";
#include
#include
using namespace std;
// Class definition.
class CNGMiniMart {
public:
//Constructors.
CNGMiniMart();
CNGMiniMart(int inItemCode, int inInventGroup, int inQty, int inReorderQty, float inUnitCost, float inUnitPrice);
//Member functions - functions that belong to this class.
int getItemCode() const;
int getQty();
int getInventGroup();
int getReorderQty();
void reOrder(int reorderQty);
private:
//Member attributes - attributes/variables that belong to this class.
int itemCode, inventGroup, qty, reorderQty;
float unitCost, unitPrice;
};
CNGMiniMart::CNGMiniMart() {
itemCode = 0;
inventGroup = 0;
qty = 0;
reorderQty = 0;
unitCost = 0;
unitPrice = 0;
}
CNGMiniMart::CNGMiniMart(int inItemCode, int inInventGroup, int inQty, int inReorderQty, float inUnitCost, float inUnitPrice) {
itemCode = inItemCode;
inventGroup = inInventGroup;
qty = inQty;
reorderQty = inReorderQty;
unitCost = inUnitCost;
unitPrice = inUnitPrice;
}
int CNGMiniMart::getItemCode() const {
return itemCode;
}
int CNGMiniMart::getQty() {
return qty;
}
int CNGMiniMart::getInventGroup() {
return inventGroup;
}
int CNGMiniMart::getReorderQty() {
return reorderQty;
}
void CNGMiniMart::reOrder(int reorderQty) {
qty += reorderQty;
}
Try something like this:Originally posted by Ito_^:code:error C2446: '==' : no conversion from 'int' to 'int (__thiscall CNGMiniMart::*)(void)'code:error C2040: '==' : 'int (__thiscall CNGMiniMart::*)(void)' differs in levels of indirection from 'int'
What does these mean?
What exactly you want to know?Originally posted by BaByBoY:hello i need help..
anyone knows how to make a C++ programs fro changeing 24 hr format to 12 hr format ???
thx in advance
the prof wans am and pm oneOriginally posted by SnowFlag:What exactly you want to know?
If you already have the 24hr format, just check if the hour is greater than 13, and then substract by 12 to give you the 12 hr format.
Gee, I wonder if your lecturer got teach u all anything or notOriginally posted by BaByBoY:the prof wans am and pm one
he say wat if user input A-Z or no greater than 24
how????
i damn struck...
i got the basic structure..Originally posted by SnowFlag:Gee, I wonder if your lecturer got teach u all anything or not
Post the code and errors.Originally posted by BaByBoY:i got the basic structure..
but i`ve got many many x errors..
haiz
I can help u by solving errors, but not writing the whole program.Originally posted by BaByBoY:i got the basic structure..
but i`ve got many many x errors..
haiz