由买买提看人间百态

topics

全部话题 - 话题: itemtobuy
(共0页)
s******8
发帖数: 4192
1
class husband
{
public:
char* itemToBuy;
void buy()
{
buy(itemToBuy);
}
bool seeEgg()
{
....
}
};
husband* pCurrentHusband = Marriage::GetNewHusband();
pCurrentHusband->itemToBuy = "bread";
if (pCurrentHusband->seeEgg())
{
pCurrentHusband->buy();
pCurrentHusband->buy();
pCurrentHusband->buy();
pCurrentHusband->buy();
pCurrentHusband->buy();
pCurrentHusband->buy();
delete pCurrentHusband;
pCurrentHusband = null;
}
else
{
pCurrentHusban... 阅读全帖
(共0页)